taxon_id | R Documentation |
Used to store the ID corresponding to taxa, either arbitrary or from a particular taxonomy database. This is typically used to store taxon IDs in taxon objects.
taxon_id(id = character(), db = "", .names = NULL)
id |
Zero or more taxonomic ids. Inputs will be transformed to a character vector if possible. |
db |
The name(s) of the database(s) associated with the IDs. If not |
.names |
The names that will be applied to the vector. |
An S3
object of class taxa_taxon_id
Other classes:
[.taxa_classification()
,
classification()
,
taxon_authority()
,
taxon_db()
,
taxon_rank()
,
taxon()
# Making new objects x <- taxon_id(c('A', 'B', 'C')) x <- taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi') x <- taxon_id(c('9606', '1386', '4890', '4345'), db = c('ncbi', 'ncbi', 'itis', 'itis')) names(x) <- c('a', 'b', 'c', 'd') # Manipulating objects as.character(x) x[2:3] x[2:3] <- 'ABC' x[c('a', 'c')] <- '123' x[['b']] <- taxon_id('123423', db = 'ncbi') tax_db(x) tax_db(x) <- 'nbn' c(x, x) # Using as columns in tables tibble::tibble(x = x, y = 1:4) data.frame(x = x, y = 1:4) # Convert to tables tibble::as_tibble(x) as_data_frame(x) # Trying to use an invalid ID with a specified database causes an error #taxon_id('NOLETTERS', db = 'ncbi')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.