map_nodes_ott: Add Open Tree of Life Taxonomy to tree nodes.

View source: R/opentree_chronograms.R

map_nodes_ottR Documentation

Add Open Tree of Life Taxonomy to tree nodes.

Description

Add Open Tree of Life Taxonomy to tree nodes.

Usage

map_nodes_ott(tree)

Arguments

tree

A tree either as a newick character string or as a phylo object.

Value

A phylo object with "nodelabels".

Examples

## 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

datelife documentation built on July 10, 2023, 2:02 a.m.