reBalance: Change balance of tree

Description Usage Arguments Details References Examples

Description

Return a tree with balance changed.

Usage

1
reBalance(tree, steps)

Arguments

tree

phylogenetic tree (ape class)

steps

number of tip switches to perform

Details

The functions switches tips in tree to make the tree more or less balanced. If steps is positive, the tree will be made more balanced else more unbalanced. Steps determines the number of tip switches in a balanced or unbalanced direction.

References

No references yet! https://github.com/DomBennett/MoreTreeTools.

Examples

1
2
3
4
5
6
7
# Make an unbalanced tree balanced
n <- 16
tree <- compute.brlen (stree (n, 'left'))
plot (tree, show.tip.label=FALSE, edge.width=2, main='Unbalanced')
# +11 steps to make tree balanced
tree <- reBalance (tree, 11)
plot (tree, show.tip.label=FALSE, edge.width=2, main='Rebalanced')

DomBennett/MoreTreeTools documentation built on May 6, 2019, 2:51 p.m.