create_fully_balanced_tree {treestats} | R Documentation |
Create a fully balanced tree
Description
This function takes an input phylogeny, and returns a phylogeny that is most ideally balanced tree, whilst having the same branching times as the original input tree. Please note that if the number of tips is not even or not a power of two, the tree may not have perfect balance, but the most ideal balance possible.
Usage
create_fully_balanced_tree(phy)
Arguments
phy |
phylo object |
Value
phylo phylo object
Examples
phy <- ape::rphylo(n = 16, birth = 1, death = 0)
bal_tree <- treestats::create_fully_balanced_tree(phy)
treestats::colless(phy)
treestats::colless(bal_tree) # much lower
[Package treestats version 1.70.4 Index]