Learn R Programming

SP2000 (version 0.2.0)

search_taxon_id: 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

string familyID ,scientificName or commonName.

name

character name = c("familyID","scientificName","commonName"),the default value is "scientificName".

start

intenger Record number to start at. If omitted, the results are returned from the first record (start=1). Use in combination with limit to page through results. Note that we do the paging internally for you, but you can manually set the start parameter.

limit

intenger Number of records to return. This is passed across all sources,when you first query, set the limit to something smallish so that you can get a result quickly, then do more as needed.

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 mclapply for details.

Value

dataframe

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

Examples

Run this code
# 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")

# }

Run the code above in your browser using DataLab