View source: R/old_taxa--taxonomy--s3.R
roots | R Documentation |
Return the root taxa for a [taxonomy()] or [taxmap()] object. Can also be used to get the roots of a subset of taxa.
obj$roots(subset = NULL, value = "taxon_indexes") roots(obj, subset = NULL, value = "taxon_indexes")
obj |
The [taxonomy()] or [taxmap()] object containing taxon information to be queried. |
subset |
Taxon IDs, TRUE/FALSE vector, or taxon indexes to find roots for. Default: All taxa in 'obj' will be used. Any variable name that appears in [all_names()] can be used as if it was a vector on its own. |
value |
What data to return. This is usually the name of column in a table in 'obj$data'. Any result of 'all_names(obj)' can be used, but it usually only makes sense to data that corresponds to taxa 1:1, such as [taxon_ranks()]. By default, taxon indexes are returned. |
'character'
Other taxonomy indexing functions:
branches()
,
internodes()
,
leaves()
,
stems()
,
subtaxa()
,
supertaxa()
# Return indexes of root taxa
roots(ex_taxmap)
# Return indexes for a subset of taxa
roots(ex_taxmap, subset = 2:17)
# Return something besides taxon indexes
roots(ex_taxmap, value = "taxon_names")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.