filter_id: Return a taxonomic table matching the requested ids

View source: R/filter_id.R

filter_idR Documentation

Return a taxonomic table matching the requested ids

Description

Return a taxonomic table matching the requested ids

Usage

filter_id(
  id,
  provider = getOption("taxadb_default_provider", "itis"),
  type = c("taxonID", "acceptedNameUsageID"),
  version = latest_version(),
  collect = TRUE,
  db = td_connect()
)

Arguments

id

taxonomic id, in prefix format

provider

from which provider should the hierarchy be returned? Default is 'itis', which can also be configured using ⁠options(default_taxadb_provider=...")⁠. See ⁠[td_create]⁠ for a list of recognized providers.

type

id type. Can be taxonID or acceptedNameUsageID, see details.

version

Which version of the taxadb provider database should we use? defaults to latest. See tl_import for details.

collect

logical, default TRUE. Should we return an in-memory data.frame (default, usually the most convenient), or a reference to lazy-eval table on disk (useful for very large tables on which we may first perform subsequent filtering operations.)

db

a connection to the taxadb database. See details.

Details

Use type="acceptedNameUsageID" to return all rows for which this ID is the accepted ID, including both synonyms and and accepted names (since both all synonyms of a name share the same acceptedNameUsageID.) Use taxonID (default) to only return those rows for which the Scientific name corresponds to the taxonID.

Some providers (e.g. ITIS) assign taxonIDs to synonyms, most others only assign IDs to accepted names. In the latter case, this means requesting taxonID will only match accepted names, while requesting matches to the acceptedNameUsageID will also return any known synonyms. See examples.

Value

a data.frame with id and name of all matching species

See Also

Other filter_by: filter_by(), filter_common(), filter_name(), filter_rank()

Examples


  

filter_id(c("ITIS:1077358", "ITIS:175089"))
filter_id("ITIS:1077358", type="acceptedNameUsageID")



taxadb documentation built on March 31, 2023, 10:20 p.m.