make.treats | R Documentation |
Combines a tree and some associated data into a treats object (e.g. for plotting)
make.treats(tree, data)
tree |
a phylogenetic tree. |
data |
a dataset of traits, either a |
This function outputs a treats
object that is a list of at least two elements: $tree
, a "phylo"
object and $data
, a "matrix"
of the trait values.
Thomas Guillerme
treats
plot.treats
## Creating a random tree
my_tree <- rtree(5)
## Adding node labels
my_tree$node.label <- letters[1:4]
## Creating a random dataset
my_data <- matrix(rnorm(9),
dimnames = list(c(my_tree$tip.label, my_tree$node.label)))
## Creating the treats object
my_treats <- make.treats(tree = my_tree, data = my_data)
plot(my_treats)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.