| Type: | Package | 
| Title: | Catalogue of Life Toolkit | 
| Version: | 0.2.0 | 
| Date: | 2020-10-26 | 
| Maintainer: | Liuyong Ding <ly_ding@126.com> | 
| Description: | A programmatic interface to http://sp2000.org.cn, re-written based on an accompanying 'Species 2000' API. Access tables describing catalogue of the Chinese known species of animals, plants, fungi, micro-organisms, and more. This package also supports access to catalogue of life global http://catalogueoflife.org, China animal scientific database http://zoology.especies.cn and catalogue of life Taiwan https://taibnet.sinica.edu.tw/home_eng.php. The development of 'SP2000' package were supported by Biodiversity Survey and Assessment Project of the Ministry of Ecology and Environment, China <2019HJ2096001006>,Yunnan University's "Double First Class" Project <C176240405> and Yunnan University's Research Innovation Fund for Graduate Students <2019227>. | 
| Depends: | R (≥ 3.0.0) | 
| Imports: | jsonlite, tibble, pbmcapply, purrr, rlist, XML, xml2, DT, urltools | 
| Suggests: | utils, testthat | 
| License: | Artistic-2.0 | 
| URL: | https://otoliths.github.io/SP2000/ | 
| BugReports: | https://github.com/Otoliths/SP2000/issues | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 7.1.1 | 
| NeedsCompilation: | no | 
| Packaged: | 2020-10-26 13:41:08 UTC; yong | 
| Author: | Liuyong Ding  | 
| Repository: | CRAN | 
| Date/Publication: | 2020-10-26 17:40:02 UTC | 
Catalogue of Life Toolkit
Description
This package is designed for mining the checklist of animals, plants, fungi and micro-organisms both in and outside China.
Details
| Package: | SP2000 | 
| Type: | Package | 
| Title: | Catalogue of Life Toolkit | 
| Version: | 0.2.0 | 
| Date: | 2020-10-26 | 
| Authors@R: | c( person(given = "Liuyong", family = "Ding", email = "ly_ding@126.com", role = c("aut", "cre"), comment = c(ORCID="0000-0002-5490-182X")), person(given = "Minrui", family = "Huang", email = "minrui-huang@mail.ynu.edu.cn", role = "ctb"), person(given = "Ke", family = "Yang", email = "ydyangke@163.com", role = "ctb"), person(given = "Jun", family = "Wang", email = "wangjun168@ynu.edu.cn", role = "ctb", comment = c(ORCID="0000-0003-2481-1409")), person(given = "Juan", family = "Tao", email = "taojuanat@gmail.com", role = "ctb"), person(given = "Chengzhi", family = "Ding", email = "chzhding@ynu.edu.cn", role = "ctb", comment = c(ORCID="0000-0001-5215-7374")), person(given = "Daming", family = "He", email = "dmhe@ynu.edu.cn", role = "ctb") ) | 
| Maintainer: | Liuyong Ding <ly_ding@126.com> | 
| Description: | A programmatic interface to <http://sp2000.org.cn>, re-written based on an accompanying 'Species 2000' API. Access tables describing catalogue of the Chinese known species of animals, plants, fungi, micro-organisms, and more. This package also supports access to catalogue of life global <http://catalogueoflife.org>, China animal scientific database <http://zoology.especies.cn> and catalogue of life Taiwan <https://taibnet.sinica.edu.tw/home_eng.php>. The development of 'SP2000' package were supported by Biodiversity Survey and Assessment Project of the Ministry of Ecology and Environment, China <2019HJ2096001006>,Yunnan University's "Double First Class" Project <C176240405> and Yunnan University's Research Innovation Fund for Graduate Students <2019227>. | 
| Depends: | R (>= 3.0.0) | 
| Imports: | jsonlite, tibble, pbmcapply, purrr, rlist, XML, xml2, DT, urltools | 
| Suggests: | utils, testthat | 
| License: | Artistic-2.0 | 
| URL: | https://otoliths.github.io/SP2000/ | 
| BugReports: | https://github.com/Otoliths/SP2000/issues | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 7.1.1 | 
| Author: | Liuyong Ding [aut, cre] (<https://orcid.org/0000-0002-5490-182X>), Minrui Huang [ctb], Ke Yang [ctb], Jun Wang [ctb] (<https://orcid.org/0000-0003-2481-1409>), Juan Tao [ctb], Chengzhi Ding [ctb] (<https://orcid.org/0000-0001-5215-7374>), Daming He [ctb] | 
Index of help topics:
SP2000-package          Catalogue of Life Toolkit
download_col_china      Download 'Catalogue of Life China': Annual
                        Checklist
find_synonyms           Find synonyms via species name
get_col_global          Search Catalogue of Life Global checklist
get_col_taiwan          Search Catalogue of Life Taiwan checklist
get_province            Statistics on Species or Infraspecies by
                        Province from Catalogue of Life China checklist
get_redlist_china       Query Redlist of Chinese Biodiversity
get_top20               Download the top20 species for Catalogue of
                        Life China checklist
list_df                 Catalogue of Life list(s) convert data frame
open_url                Opening the Catalogue of Life China checklist
                        web pages with query
search_checklist        Search Catalogue of Life China checklist
search_family_id        Search family IDs
search_taxon_id         Search taxon IDs
set_search_key          SP2000 API keys
zoology_dbase_name      Query details of species in China Animal
                        Scientific Database
zoology_description     Query details of species in China Animal
                        Scientific Database
Author(s)
Maintainer: Liuyong Ding <ly_ding@126.com>
References
Ding LY, Li H, Tao J, Zhang JL, Huang MR, Yang K, Wang J, He DM, Ding CZ (2020) SP2000: An open-sourced R package for querying the Catalogue of Life. Biodiversity Science.
https://cran.r-project.org/package=SP2000
https://pypi.org/project/SP2000
Examples
## Not run: 
# Note: You need to apply for the apiKey <http://sp2000.org.cn/api/document>
to run search_* functions of this package.
## Load "SP2000"
library('SP2000')
## Set your key
set_search_key("your apiKey",db = "sp2000")
## Search family IDs via family name, supports Latin and Chinese names
familyid <- search_family_id(query = "Anguillidae")
## Search taxon IDs via familyID ,scientificName and commonName
query <- familyid$Anguillidae$data$record_id
taxonid <- search_taxon_id(query = query,name = "familyID")
queries = c("Anguilla marmorata","Anguilla japonica",
            "Anguilla bicolor","Anguilla nebulosa",
            "Anguilla luzonensis")
search_taxon_id(query = queries,name = "scientificName")
## Download detailed lists via species or infraspecies ID
query <- taxonid[["3851c5311bed46c19529cb155d37aa9b"]][["data"]][["namecode"]]
checklist <- search_checklist(query = query)
## Get Catalogue of Life Global checklist via species name and id
x <- get_col_global(query = "Anguilla", response = "full")
str(x)
x[["Anguilla"]][["meta"]][["total_number_of_results"]] [1]
## Find synonyms via species name from Catalogue of Life Global
find_synonyms(query = queries)
## Search Catalogue of Life Taiwan checklist
get_col_taiwan(query = "Anguillidae", level = "family")
## Query Redlist of Chinese Biodiversity
get_redlist_china(query = "Anguilla", option = "Scientific Names")
## End(Not run)
Download 'Catalogue of Life China': Annual Checklist
Description
Organized by the Biodiversity Committee of Chinese Academy of Sciences (BC-CAS), Catalogue of Life China Annual Checklist edition has been compiled by Species 2000 China Node.
Usage
download_col_china(version = "2020", OS = "MacOS", dir = tempdir(), mode, ...)
Arguments
version | 
 
  | 
OS | 
 
  | 
dir | 
 a non-empty character vector giving the directory name by user,the default value is dir = tempdir(),see   | 
mode | 
 A character string specifying the mode with which to write the file. Useful values are "w", "wb" (binary), "a" (append) and "ab". see   | 
... | 
 allow additional arguments to be passed, unused.see   | 
Details
Visit the website http://sp2000.org.cn/download for more details.
Value
URL
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
dir <- tempdir()
download_col_china(version = "2020",OS = "MacOS", dir = dir)
## End(Not run)
Find synonyms via species name
Description
Find synonyms via species name from Catalogue of Life Global.
Usage
find_synonyms(query, mc.cores = 2)
Arguments
query | 
 
  | 
mc.cores | 
 The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores,see   | 
Details
Visit the website http://webservice.catalogueoflife.org/col/webservice for more details.
Value
object
Author(s)
Liuyong Ding ly_ding@126.com
References
https://github.com/lutteropp/SpeciesSynonymFinder/blob/master/find_synonyms.r
Examples
## Not run: 
##Get Catalogue of Life Global checklist via species name
x1 <- get_col_global(query = c("Anguilla marmorata","Anguilla japonica",
                              "Anguilla bicolor","Anguilla nebulosa",
                              "Anguilla luzonensis"),
                               option = "name")
str(x1)
##full queries
x2 <- get_col_global(query = "Anguilla", response = "full")
##Find synonyms via species name
find_synonyms(query = c("Anguilla marmorata","Anguilla japonica",
                        "Anguilla bicolor","Anguilla nebulosa",
                        "Anguilla luzonensis"))
## End(Not run)
Search Catalogue of Life Global checklist
Description
Get Catalogue of Life Global checklist via species name and id.
Usage
get_col_global(
  query,
  option = "name",
  response = "terse",
  start = 0,
  limit = 500,
  mc.cores = 2
)
Arguments
query | 
 
  | 
option | 
 
  | 
response | 
 
  | 
start | 
 
  | 
limit | 
 
  | 
mc.cores | 
 The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores,see   | 
Details
Visit the website http://webservice.catalogueoflife.org/col/webservice for more details.
Value
object
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Get Catalogue of Life Global checklist via species name
x1 <- get_col_global(query = c("Anguilla marmorata","Anguilla japonica",
                              "Anguilla bicolor","Anguilla nebulosa",
                              "Anguilla luzonensis"),
                               option = "name")
str(x1)
##full queries
x2 <- get_col_global(query = "Anguilla", response = "full")
##Find synonyms via species name
find_synonyms(query = c("Anguilla marmorata","Anguilla japonica",
                        "Anguilla bicolor","Anguilla nebulosa",
                        "Anguilla luzonensis"))
## End(Not run)
Search Catalogue of Life Taiwan checklist
Description
Get Catalogue of Life Taiwan checklist via advanced query.
Usage
get_col_taiwan(
  query,
  level = "species",
  option = "equal",
  include_synonyms = TRUE
)
Arguments
query | 
 
  | 
level | 
 
  | 
option | 
 
  | 
include_synonyms | 
 
  | 
Details
Visit the website https://taibnet.sinica.edu.tw/eng/taibnet_species_query.php for more details.
Value
object
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Search Catalogue of Life Taiwan checklist
get_col_taiwan(query="Anguilla",level="species",option = "contain")
get_col_taiwan(query="Anguillidae",level="family")
## End(Not run)
Statistics on Species or Infraspecies by Province from Catalogue of Life China checklist
Description
Download the statistics datasets on species/infraspecies by province at http://sp2000.org.cn/statistics/statistics_map for more details.
Usage
get_province()
Details
Visit the website http://sp2000.org.cn/statistics/statistics_map for more details.
Value
Statistics on species or infraspecies by province.
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
get_province()
## End(Not run)
Query Redlist of Chinese Biodiversity
Description
Query Redlist of China’s Biodiversity of Vertebrate, Higher Plants and Macrofungi.
Usage
get_redlist_china(
  query = NULL,
  option = "Scientific Names",
  group = "Amphibians",
  viewDT = FALSE
)
Arguments
query | 
 
  | 
option | 
 
  | 
group | 
 
  | 
viewDT | 
 
  | 
Format
assessment status:
- EX
 Extinct
- EW
 Extinct in the wild
- RE
 Regional Extinct
- CR
 Critically Endangered
- EN
 Endangered
- VU
 Vulnerable
- NT
 Near Threatened
- LC
 Least Concern
- DD
 Data Deficient
Details
Visit the website http://zoology.especies.cn/ for more details.
Value
object
Author(s)
Liuyong Ding ly_ding@126.com
Ke Yang ydyangke@163.com
References
http://www.iplant.cn/rep/protlist
Examples
## Not run: 
#query assessment status via Chinese Names or Scientific Names
get_redlist_china(query = "Anguilla", option = "Scientific Names")
get_redlist_china(query = "Anguilla nebulosa", option = "Scientific Names")
#creates an HTML widget to display rectangular data
get_redlist_china(group = "Inland Fishes", viewDT = TRUE)
## End(Not run)
Download the top20 species for Catalogue of Life China checklist
Description
Download the most visited top20 species from http://sp2000.org.cnfor more details.
Usage
get_top20()
Details
Visit the website http://sp2000.org.cn for more details.
Value
top20 species
Author(s)
Liuyong Ding
Examples
## Not run: 
get_top20()
## End(Not run)
Catalogue of Life list(s) convert data frame
Description
Checklist lists convert data frame.
Usage
list_df(x, db = c("colchina", "colglobal"))
Arguments
x | 
 
  | 
db | 
 
  | 
Format
A data frame with 19 variables:
- ScientificName
 The scientific name (the accepted name) includes the name and the date of the name
- Synonyms
 Synonyms name, Latin
- ChineseName
 Chinese name
- CommonNames
 Common name
- Kingdom
 Kingdom at taxonTree
- Phylum
 Phylum at taxonTree
- Class
 Class at taxonTree
- Order
 Order at taxonTree
- Family
 Family at taxonTree
- Genus
 Genus at taxonTree
- Species
 Species at taxonTree
- Infraspecies
 Infraspecies at taxonTree
- Distribution
 Distribution of species or infraspecies
- Name
 Full name of reviewer in English or Chinese
Organization of the reviewer in English or Chinese
- Address
 Email address of the reviewer
- Institution
 Address of the reviewer in English or Chinese
- References
 References
- Download
 Download date
Author(s)
Liuyong Ding ly_ding@126.com
Source
Visit the website http://sp2000.org.cn/api/document for more details
Examples
## Not run: 
##Set your key
set_search_key <- "your apiKey"
##Search family IDs via family name
familyid <- search_family_id(query = "Anguillidae")
##Search taxon IDs via familyID
taxonid <- search_taxon_id(query = familyid$Anguillidae$data$record_id, name = "familyID")
#Download detailed lists via species or infraspecies ID
query <- taxonid[["3851c5311bed46c19529cb155d37aa9b"]][["data"]][["namecode"]]
x1 <- search_checklist(query = query)
str(x1)
x1 <- list_df(x1,db = "colchina")
#Get Catalogue of Life Global checklist via species name
x2 <- get_col_global(query = c("Anguilla marmorata","Anguilla japonica",
                               "Anguilla bicolor","Anguilla nebulosa",
                               "Anguilla luzonensis"),
                               option = "name")
str(x2)
x2 <- list_df(x2,db = "colglobal")
## End(Not run)
Opening the Catalogue of Life China checklist web pages with query
Description
Query with the accceptedName,scientificName,chineseName and commonName, returning the web pages that meets the criteria.
Usage
open_url(query = NULL, name = "accceptedName", language = "en")
Arguments
query | 
 
  | 
name | 
 
  | 
language | 
 
  | 
Details
Visit the website http://sp2000.org.cn/pageservices/document for more details.
Author(s)
Liuyong Ding
Liuyong Ding ly_ding@126.com
Examples
open_url(query = "Anguilla marmorata",name = "scientificName",language = 'en')
open_url(query = "Anguilla marmorata",name = "scientificName",language = 'zh')
Search Catalogue of Life China checklist
Description
Get checklist via species or infraspecies ID.
Usage
search_checklist(query = NULL, mc.cores = 2)
Arguments
query | 
 
  | 
mc.cores | 
 The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores,see   | 
Details
Visit the website http://sp2000.org.cn/api/document for more details.
Value
Catalogue of Life China list(s)
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Set your key
set_search_key("your apiKey",db = "sp2000")
##Search family IDs via family name
familyid <- search_family_id(query = "Anguillidae")
##Search taxon IDs via familyID
taxonid <- search_taxon_id(query = familyid$Anguillidae$data$record_id,name = "familyID")
#Download detailed lists via species or infraspecies ID
query <- taxonid[["3851c5311bed46c19529cb155d37aa9b"]][["data"]][["namecode"]]
x <- search_checklist(query = query)
str(x)
## End(Not run)
Search family IDs
Description
Search family IDs via family name, supports Latin and Chinese names.
Usage
search_family_id(query = NULL, start = 1, limit = 20, mc.cores = 2)
Arguments
query | 
 
  | 
start | 
 
  | 
limit | 
 
  | 
mc.cores | 
 The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores,see   | 
Details
Visit the website http://sp2000.org.cn/api/document for more details
Value
dataframe
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Set your key
set_search_key("your apiKey",db = "sp2000")
##Search family IDs via family name
familyid <- search_family_id(query = "Anguillidae")
## End(Not run)
Search taxon IDs
Description
Search taxon IDs via familyID ,scientificName and commonName.
Usage
search_taxon_id(
  query = NULL,
  name = "scientificName",
  start = 1,
  limit = 20,
  mc.cores = 2
)
Arguments
query | 
 
  | 
name | 
 
  | 
start | 
 
  | 
limit | 
 
  | 
mc.cores | 
 The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores,see   | 
Format
query:
- taxonIDs
 an array of species' ids
- familyID
 family ID, unique value
- scientificName
 the scientific name, or part of the scientific name, supports Latin names and Chinese
- commonName
 common name, or part of common name
Details
Visit the website http://sp2000.org.cn/api/document for more details
Value
dataframe
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Set your key
set_search_key("your apiKey",db = "sp2000")
##Search family IDs via family name
familyid <- search_family_id(query = "Anguillidae")
##Search taxon IDs via familyID
taxonid <- search_taxon_id(query = familyid$Anguillidae$data$record_id,name = "familyID")
## End(Not run)
SP2000 API keys
Description
Apply for the apiKey variable to be used by all search_* functions and zoology_* functions, register for http://sp2000.org.cn/api/document and use an API key. This function allows users to set this key. Note: The daily API visits of ordinary users are 2000, If you want to apply for increasing the daily API request limit, please fill in the application form http://col.especies.cn/doc/API.docx and send an email to SP2000CN@ibcas.ac.cn entitled "Application for increasing API Request Times".
Usage
set_search_key(key, db = "sp2000")
Arguments
key | 
 
  | 
db | 
 
  | 
Value
A logical of length one, TRUE is the value was set FALSE if not. value is returned inside invisible(), i.e. it is not printed to screen when the function is called.
Author(s)
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
#Set the apiKey variable to be used by all search_* functions
set_search_key("your apiKey",db = "sp2000")
#Set the apiKey variable to be used by all zoology_* functions
set_search_key("your apiKey",db = "zoology")
## End(Not run)
Query details of species in China Animal Scientific Database
Description
Query the database name and return a collection of names for all databases.
Usage
zoology_dbase_name()
Format
China Animal Scientific Database
- 1
 Chinese zoology database
- 2
 China Animal Map Database
- 3
 China Economic Animal Database
- 4
 Chinese Bird Database
- 5
 Chinese Mammal Database
- 6
 China Butterfly Database
- 7
 Chinese Bee Database
- 8
 China Inland Water Fish Database
- 9
 Chinese Amphibian Database
- 10
 Chinese Reptile database
- ...
 allow additional more databases to be used
Details
Visit the website http://zoology.especies.cn for more details.
Value
A collection of names for all China animal scientific databases
Author(s)
Liuyong Ding ly_ding@126.com
Ke Yang ydyangke@163.com
References
Examples
## Not run: 
##Set your key
set_search_key("your apiKey",db = "zoology")
#Query China Animal Scientific Database lists
zoology_dbase_name()
## End(Not run)
Query details of species in China Animal Scientific Database
Description
Query the description information based on the species name, database name, and description type.
Query the description type information based on the species name and database name.
Usage
zoology_description(query, dbname, destype)
zoology_description_type(query, dbname)
Arguments
query | 
 
  | 
dbname | 
 
  | 
destype | 
 
  | 
Details
Visit the website http://zoology.especies.cn for more details.
Visit the website http://zoology.especies.cn for more details.
Value
details of species in China Animal Scientific Database
description type information
Author(s)
Liuyong Ding ly_ding@126.com
Liuyong Ding ly_ding@126.com
Examples
## Not run: 
##Set your key
set_search_key("your apiKey",db = "zoology")
##Query details of species in Chinese Bird Database
zoology_description(query = "Aix galericulata",dbname = 4,destype = 209)
## End(Not run)
## Not run: 
##Set your key
set_search_key("your apiKey",db = "zoology")
##Query description type information of Chinese Bird Database
zoology_description_type(query = "Aix galericulata",dbname = 4)
## End(Not run)