taxize (version 0.1.5)

tax_rank: Get rank for a given taxonomic name.

Description

Get taxonomic rank for a given taxon 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.
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
tax_rank(query = "Helianthus annuus", db = "itis")
tax_rank(query = "Helianthus annuus", db = "ncbi")
tax_rank(query = "Helianthus", db = "itis")
tax_rank(query = "Baetis rhodani", db = "itis")

# query both
tax_rank(query=c("Helianthus annuus", 'Baetis rhodani'), db="both")

# An alternative way would be to use \link{classification} and sapply over
the list
x <- 'Baetis'
classi <- classification(get_uid(x))
sapply(classi, function(x) x[nrow(x), 'Rank'])

Run the code above in your browser using DataLab