add.random {phytools} | R Documentation |
Add tips at random to the tree
Description
This function adds new tips at random to a tree with branch lengths.
Usage
add.random(tree, n=NULL, tips=NULL, edge.length=NULL, order=c("random","input"))
Arguments
tree |
an object of class |
n |
a number of tips to add to the tree. If |
tips |
a set of tip names for the added tips. If |
edge.length |
terminal edge length for the added tips. If |
order |
addition order for the new tips. |
Details
If no edge lengths are provided, and the tree is ultrametric, then edge lengths are assigned to keep the tree ultrametric.
The probability that at new tip is added along any branch is directly proportional to the length of the branch.
Note that sometimes the resultant tree plotted with plot.phylo
or plotSimmap
may display with branches crossing. If so, the tree can be 'untangled' using untangle
.
Value
An object of class "phylo"
.
Author(s)
Liam Revell liam.revell@umb.edu
References
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.