taxadb (version 0.1.0)

get_ids: get_ids

Description

A drop-in replacement for [taxize::get_ids()]

Usage

get_ids(
  names,
  db = getOption("taxadb_default_provider", "itis"),
  format = c("prefix", "bare", "uri"),
  version = latest_version(),
  taxadb_db = td_connect(),
  ignore_case = TRUE,
  ...
)

Arguments

names

a list of scientific names (which may include higher-order ranks in most authorities).

db

abbreviation code for the provider. See details.

format

Format for the returned identifier, one of

  • prefix (e.g. NCBI:9606, the default), or

  • bare (e.g. 9606, used in taxize::get_ids()),

  • uri (e.g. http://ncbi.nlm.nih.gov/taxonomy/9606).

version

Which version of the taxadb provider database should we use? defaults to latest. see [avialable_releases()] for details.

taxadb_db

Connection to from [td_connect()].

ignore_case

should we ignore case (capitalization) in matching names? default is TRUE.

...

additional arguments (currently ignored)

Value

a vector of IDs, of the same length as the input names Any unmatched names or multiply-matched names will return as NAs. To resolve multi-matched names, use [filter_name()] instead to return a table with a separate row for each separate match of the input name.

Details

Note that some taxize authorities: nbn, tropicos, and eol, are not recognized by taxadb and will throw an error here. Meanwhile, taxadb recognizes several authorities not known to [taxize::get_ids()]. Both include itis, ncbi, col, and gbif.

Like all taxadb functions, this function will run fastest if a local copy of the provider is installed in advance using [td_create()].

See Also

filter_name

Other get: get_names()

Examples

Run this code
# NOT RUN {
get_ids("Homo sapiens")
get_ids(c("Homo sapiens", "Mammalia"), format = "prefix")
get_ids("Homo sapiens", db= "ncbi", format = "uri")
# }

Run the code above in your browser using DataLab