taxo_id.RdGet the ids of taxa from their names
taxo_id(taxon_names, taxo)
| taxon_names | vector of character strings with taxonomic names |
|---|---|
| taxo | a taxonomy data.frame, typically from |
A vector ids, one for each element of taxon_names. Currently, this does not disambiguate between taxa with the same name and just returns the id of the first match in the taxonomy.
Other taxonomy-related functions:
ancestors(),
as.taxo(),
children(),
descendants(),
extract_taxo(),
is_leaf(),
lineage(),
parent(),
taxo_name()
taxo#> id parent_id name #> 1 1 NA living #> 2 2 1 fish #> 3 3 1 mollusc #> 4 4 2 egg #> 5 5 3 snail #> 6 6 3 squid #> 7 7 5 eggtaxo_id("squid", taxo)#> [1] 6taxo_id("foo", taxo)#> [1] NA# NB: taxo_id("egg", taxo)#> [1] 4