make.treats {treats} | R Documentation |
Make a treats object
Description
Combines a tree and some associated data into a treats object (e.g. for plotting)
Usage
make.treats(tree, data)
Arguments
tree |
a phylogenetic tree. |
data |
a dataset of traits, either a |
Value
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.
Author(s)
Thomas Guillerme
See Also
Examples
## 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)
[Package treats version 1.0 Index]