Learn R Programming

taxize (version 0.7.9)

tax_rank: Get rank for a given taxonomic name.

Description

Get rank for a given taxonomic name.

Usage

tax_rank(query = NULL, db = "itis", pref = "ncbi", verbose = TRUE, ...)

Arguments

query
character; Vector of taxonomic names to query.
db
character; The database to search from: 'tis', 'ncbi' or 'both'. If 'both' both NCBI and ITIS will be queried. Result will be the union of both. Note that each taxonomic data source has their own identifiers, so that if you provide the wrong db value for the identifier you could get a result, but it will likely be wrong (not what you were expecting).
pref
If db = 'both', sets the preference for the union. Either 'ncbi' or 'itis'.
verbose
logical; If TRUE the actual taxon queried is printed on the console.
...
Other arguments passed to get_tsn or get_uid.

Value

A data.frame with one column for every queried taxon.

See Also

classification, tax_name

Examples

Run this code
## Not run: 
# tax_rank(query = "Helianthus annuus", db = "itis")
# tax_rank(query = "Helianthus annuus", db = "ncbi")
# tax_rank(query = "Helianthus", db = "itis")
# 
# # query both
# tax_rank(query=c("Helianthus annuus", 'Puma'), db="both")
# 
# # An alternative way would be to use classification() and sapply over
# # the list
# x <- 'Baetis'
# classi <- classification(get_uid(x))
# sapply(classi, function(x) x[nrow(x), 'rank'])
# ## End(Not run)

Run the code above in your browser using DataLab