make.treats: Make a treats object

View source: R/make.treats.R

make.treatsR 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 matrix with column names or a named vector.

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

treats plot.treats

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)


treats documentation built on Nov. 24, 2023, 5:08 p.m.

Related to make.treats in treats...