Resolves the names, attaches their full higher classification, and assembles a
taxonomy tree (kingdom -> phylum -> class -> order -> family -> genus ->
species) from the shared lineages. Returns the tree as a Newick string and the
underlying classification table; when the ape package is installed, an
ape phylo object is included too.
Usage
class2tree(x, backbone = NULL, verbose = TRUE)
# S3 method for class 'taxify_tree'
print(x, ...)Value
An object of class taxify_tree: a list with
- newick
The Newick string (internal nodes labelled by rank value, tips by species name).
- classification
The classification data.frame the tree was built from.
- tip_labels
The species at the tips.
- phylo
An ape
phyloobject, orNULLif ape is not installed / the string could not be parsed.
Examples
# Runs offline against the bundled example database.
old <- options(taxify.data_dir = taxify_example_data())
tr <- class2tree(c("Quercus robur", "Quercus petraea", "Quercus pyrenaica"))
tr$newick
options(old)