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 |
---|---|
subset | Taxon IDs, TRUE/FALSE vector, or taxon indexes to find roots for.
Default: All taxa in |
value | What data to return. This is usually the name of column in a
table in |
character
Other taxonomy indexing functions:
branches()
,
internodes()
,
leaves()
,
stems()
,
subtaxa()
,
supertaxa()
# Return indexes of root taxa roots(ex_taxmap)#> b c #> 1 2# Return indexes for a subset of taxa roots(ex_taxmap, subset = 2:17)#> c d e f #> 2 3 4 5# Return something besides taxon indexes roots(ex_taxmap, value = "taxon_names")#> b c #> "Mammalia" "Plantae"