descendants | R Documentation |
Get ids of descendants of some taxa
descendants(taxon_ids, taxo, n = Inf)
taxon_ids |
internal, numeric ids of the taxa. |
taxo |
a taxonomy data.frame, typically from |
n |
maximum number of levels to look down; n=1 gives the direct children, n=2 gives children and grand-children, etc. |
Even with n=1
, the function is different from children()
because it returns all unique children for all elements of taxon_ids
, not one vector of children per element.
A vector of taxonomic ids containing the input taxon_ids
and all their descendants.
Other taxonomy-related functions:
ancestors()
,
as.taxo()
,
children()
,
extract_taxo()
,
is_leaf()
,
lineage()
,
parent()
,
taxo_id()
,
taxo_name()
print(as.Node(taxo), "id")
descendants(3, taxo)
descendants(1, taxo)
descendants(c(2,5), taxo)
descendants(7, taxo)
descendants(NA, taxo)
descendants(1, taxo, n=1)
descendants(1, taxo, n=2)
descendants(1, taxo, n=3)
descendants(1, taxo, n=10)
# NB:
descendants(5:6, taxo, n=1)
children(5:6, taxo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.