nodeImbFrac: Fraction of nodes with given imbalance

View source: R/nodeImbFrac.R

nodeImbFracR Documentation

Fraction of nodes with given imbalance

Description

Calculate the fraction of internal nodes with an imbalance greater than or equal to a given threshold.

Usage

nodeImbFrac(tree, threshold)

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.

threshold

a threshold value for node imbalance.

Value

For any internal node, the function nodeImb gives the number of tip descendants of each of the node's descending branches. The function nodeImbFrac returns the fraction of internal nodes where the difference between these numbers is greater than or equal to the threshold.

Author(s)

Michelle Kendall michelle.louise.kendall@gmail.com

See Also

nodeImb

Examples

## Find the fraction of internal nodes with an imbalance of 5 or more, 
## in a random tree with 20 tips:
tree <- rtree(20)
plot(tree)
nodeImbFrac(tree,threshold=5) 


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