tree.bind | R Documentation |
Randomly binds trees together with a provided number of trees and a root age.
tree.bind(x, y, sample, root.age)
x, y |
Two |
sample |
The number of trees to create. If missing, the |
root.age |
The age of the root where both trees are combined (can be any unit). If missing, the |
If x
, y
and sample
are >1
, the function returns a multiPhylo
object; else it returns a phylo
object.
Thomas Guillerme
## Combines 2 randomly chosen trees from x and from y into z putting the root age at 12.
x <- rmtree(10, 5) ; y <- rmtree(5, 5)
tree.bind(x, y, sample = 3, root.age = 12)
##Combines one mammal and and one bird tree and setting the root age at 250 Mya.
data(lifespan)
combined_trees <- tree.bind(trees_mammalia, trees_aves, sample = 1, root.age = 250)
plot(combined_trees) # A tree with both mammals and aves
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.