View source: R/old_taxa--taxon.R
taxon | R Documentation |
A class used to define a single taxon. Most other classes in the taxa package include one or more objects of this class.
taxon(name, rank = NULL, id = NULL, authority = NULL)
name |
a TaxonName object [taxon_name()] or character string. if character passed in, we'll coerce to a TaxonName object internally, required |
rank |
a TaxonRank object [taxon_rank()] or character string. if character passed in, we'll coerce to a TaxonRank object internally, required |
id |
a TaxonId object [taxon_id()], numeric/integer, or character string. if numeric/integer/character passed in, we'll coerce to a TaxonId object internally, required |
authority |
(character) a character string, optional |
Note that there is a special use case of this function - you can pass 'NULL' as the first parameter to get an empty 'taxon' object. It makes sense to retain the original behavior where nothing passed in to the first parameter leads to an error, and thus creating a 'NULL' taxon is done very explicitly.
An 'R6Class' object of class 'Taxon'
Other classes:
hierarchies()
,
hierarchy()
,
taxa()
,
taxmap()
,
taxon_database()
,
taxon_id()
,
taxon_name()
,
taxon_rank()
,
taxonomy()
(x <- taxon(
name = taxon_name("Poa annua"),
rank = taxon_rank("species"),
id = taxon_id(93036)
))
x$name
x$rank
x$id
# a null taxon object
taxon(NULL)
## with all NULL objects from the other classes
taxon(
name = taxon_name(NULL),
rank = taxon_rank(NULL),
id = taxon_id(NULL)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.