hierarchy.Rd
This function is used to retrieve the taxonomic hierarchy from an online database for each species in a data frame. This function requires the package 'taxize'
hierarchy(
data,
species,
db = "gbif",
ranks = c("kingdom", "phylum", "class", "order", "family", "genus", "species"),
ID = TRUE,
error.ret = TRUE
)
A data frame
A character equal to the column name of the data frame that holds the species names
A character equal to the data base name for which you want to use to search for the taxonomic
hierarchy. The possible data bases are Integrated Taxonomic Information System ('itis'
),
Global Biodiversity Information Facility ('gbif'
), The National Center for Biotechnology
Information ('ncbi'
), the Encyclopedia of Life ('eol'
), National Biodiversity
Network ('nbn'
), and Tropicos ('tropicos'
). The default is 'gbif'
. The function
uses the first ID number returned by the taxize::get_id
function.
A character or vector of rank names. The default is 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', and 'species'.
Logical. If TRUE
then a column is added to the returned data frame that indicates
if there was a some error in the retrieval of that species' hierarchy. error.ret = TRUE
checks to see
if the species name matches the species name returned in the hierarchy from the database.
A data frame that has a column for each taxonomic level of a species taxonomic hierarchy