## 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
Run the code above in your browser using DataLab