n_supertaxa {taxa} | R Documentation |
Number of supertaxa per taxon
Description
Get the number of supertaxa each taxon is contained in.
Usage
n_supertaxa(x, subset = NULL, max_depth = NULL, include = FALSE)
Arguments
x |
The object to get supertaxa for, such as a taxonomy object. |
subset |
The subset of the tree to search for roots to that subset. Can be indexes or names. |
max_depth |
The number of levels to traverse. For example, |
include |
If |
See Also
Other supertaxa functions:
supertaxa()
Examples
# Generate example data
x <- taxonomy(c('Carnivora', 'Felidae', 'Panthera', 'Panthera leo',
'Panthera tigris', 'Ursidae', 'Ursus', 'Ursus arctos'),
supertaxa = c(NA, 1, 2, 3, 3, 1, 6, 7))
# Find number of supertaxa each taxon is contained in
n_supertaxa(x)
# Only return data for some taxa (faster than subsetting the whole result)
n_supertaxa(x, subset = 1:3)
[Package taxa version 0.4.3 Index]