The forward direction of comm2sci(): given a scientific name, return the
common name(s) it is known by. Reads the bundled common_names enrichment
(GBIF, NCBI, and Open Tree vernaculars) offline; the first call may trigger
the one-time download. Where add_common_names() attaches vernaculars to a
taxify() result as columns, sci2comm() takes bare names and returns the
long lookup table – one row per (name, vernacular). A name maps to many
common names (across languages and synonyms), so a query can carry several
rows.
Arguments
- x
Character vector of scientific names.
- lang
Character. Restrict to one language: an ISO 639-1 code (
"en","de", ...) as used by the GBIF source, orNAfor the untagged NCBI/Open Tree names.NULL(default) returns every language. List the languages present withenrichment_groups("common_names").- resolve
Logical. When
TRUE(default), each input is run throughtaxify()first so a synonym or misspelling reports its accepted taxon's vernaculars. WhenFALSE, the input name is looked up verbatim (faster, offline; use when the names are already accepted).- backbone
Passed to
taxify()whenresolve = TRUE;NULL(default) uses every installed backbone. Ignored whenresolve = FALSE.- verbose
Logical. Default
TRUE.
Value
A data.frame with one row per (query, vernacular):
- input_name
The scientific name as supplied.
- accepted_name
The accepted name looked up (equals
input_namewhenresolve = FALSEor the input_name was already accepted).- common_name
A vernacular name.
- lang
Language tag (
NAfor NCBI/Open Tree).
A query with no vernacular contributes no rows.
See also
comm2sci() for the reverse direction (common -> scientific),
add_common_names() to attach vernaculars to a taxify() result.
Examples
# Runs offline against the bundled example database.
old <- options(taxify.data_dir = taxify_example_data())
# The bundled example maps Quercus robur -> "example_common_name" (en + de)
sci2comm("Quercus robur", resolve = FALSE)
options(old)