treeImb: Tree imbalance

View source: R/treeImb.R

treeImbR Documentation

Tree imbalance

Description

Find the imbalance of each node, that is the number of tip descendants of each of its two children. With thanks to Leonid Chindelevitch for use of code from computeLRValues from treeCentrality.

Usage

treeImb(tree)

Arguments

tree

a tree of class phylo or phylo4. The tree should be binary and rooted; if not it will be coerced into a binary rooted tree using multi2di, if possible.

Value

A matrix where rows correspond to nodes of the tree. The two column entries correspond to the number of tip descendants of each of its two children. (Note that this is the transform of the output in phyloTop version 1.0.0.) Where the row number corresponds to a tip, the entries are (0,0).

Author(s)

Michelle Kendall michelle.louise.kendall@gmail.com

See Also

nodeImb

Examples

## Find the imbalance numbers in a random tree with 10 tips:
tree <- rtree(10)
plot(tree)
nodelabels()
treeImb(tree)


phyloTop documentation built on Feb. 16, 2023, 5:55 p.m.