View source: R/opentree_chronograms.R
map_nodes_ott | R Documentation |
Add Open Tree of Life Taxonomy to tree nodes.
map_nodes_ott(tree)
tree |
A tree either as a newick character string or as a |
A phylo
object with "nodelabels".
## Not run: # This is a flag for package development. You are welcome to run the example.
# Load the Open Tree chronograms database cached in datelife:
utils::data(opentree_chronograms)
# Get the small chronograms (i.e., chronograms with less that ten tips) to generate a pretty plot:
small <- opentree_chronograms$trees[unlist(sapply(opentree_chronograms$trees, ape::Ntip)) < 10]
# Now, map the Open Tree taxonomy to the nodes of the first tree
phy <- map_nodes_ott(tree = small[[1]])
# and plot it:
# plot_phylo_all(phy)
library(ape)
plot(phy)
nodelabels(phy$node.label)
## End(Not run) #end dontrun
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.