View source: R/dispRity.utilities.R
add.tree | R Documentation |
Adding, extracting or removing the tree component from a dispRity
object.
add.tree(data, tree, replace = FALSE)
get.tree(data, subsets = FALSE, to.root = FALSE)
remove.tree(data)
data |
A |
tree |
A |
replace |
Logical, whether to replace any existing tree ( |
subsets |
Either a logical whether to extract the tree for each subset ( |
to.root |
Logical, whether to return the subset tree including the root of the tree ( |
get.tree
allows to extract the trees specific to each subsets.
Thomas Guillerme and Jack Hadfield
custom.subsets
, chrono.subsets
, boot.matrix
, dispRity
.
## Loading a dispRity object
data(disparity)
## Loading a tree
data(BeckLee_tree)
## Removing the tree from the dispRity object
(tree_data <- remove.tree(disparity))
## Extracting the tree
get.tree(tree_data) # is null
## Adding a tree to the disparity object
tree_data <- add.tree(tree_data, tree = BeckLee_tree)
## Extracting the tree
get.tree(tree_data) # is a "phylo" object
## Adding the same tree again
tree_data <- add.tree(tree_data, tree = BeckLee_tree)
get.tree(tree_data) # is a "multiPhylo" object (2 trees)
## Replacing the two trees by one tree
tree_data <- add.tree(tree_data, tree = BeckLee_tree, replace = TRUE)
get.tree(tree_data) # is a "phylo" object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.