View source: R/old_taxa--hierarchy.R
hierarchy | R Documentation |
A class containing an ordered list of [taxon()] objects that represent a hierarchical classification.
hierarchy(..., .list = NULL)
... |
Any number of object of class 'Taxon' or taxonomic names as character strings |
.list |
An alternate to the '...' input. Any number of object of class [taxon()] or character vectors in a list. Cannot be used with '...'. |
On initialization, taxa are sorted if they have ranks with a known order.
**Methods**
Remove 'Taxon' elements by rank name, taxon name or taxon ID. The change happens in place, so you don't need to assign output to a new object. returns self - rank_names (character) a vector of rank names
Select 'Taxon' elements by rank name, taxon name or taxon ID. The change happens in place, so you don't need to assign output to a new object. returns self - rank_names (character) a vector of rank names
An 'R6Class' object of class 'Hierarchy'
Other classes:
hierarchies()
,
taxa()
,
taxmap()
,
taxon_database()
,
taxon_id()
,
taxon_name()
,
taxon_rank()
,
taxonomy()
,
taxon()
(x <- taxon(
name = taxon_name("Poaceae"),
rank = taxon_rank("family"),
id = taxon_id(4479)
))
(y <- taxon(
name = taxon_name("Poa"),
rank = taxon_rank("genus"),
id = taxon_id(4544)
))
(z <- taxon(
name = taxon_name("Poa annua"),
rank = taxon_rank("species"),
id = taxon_id(93036)
))
(res <- hierarchy(z, y, x))
res$taxa
res$ranklist
# null taxa
x <- taxon(NULL)
(res <- hierarchy(x, x, x))
## similar to hierarchy(), but `taxa` slot is not empty
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.