Learn R Programming

treebalance (version 1.2.0)

rogersI: Calculation of the Rogers J index for rooted binary trees

Description

This function calculates the Rogers J index \(J(T)\) for a given rooted binary tree \(T\). It is defined as the number of inner vertices whose balance value is unequal to zero, more precisely $$J(T)=\sum_{u \in V_{in}(T)} (1-I(n_{u_a}=n_{u_b}))$$ in which \(V_{in}(T)\) denotes the set of all inner vertices of \(T\), and in which \(n_{u_a}\) and \(n_{u_b}\) denote the number of leaves in the two pending subtrees that are rooted at the direct descendants of \(u\).
Special cases: For \(n=1\), the function returns \(J(T)=0\) and a warning.

For details on the Rogers J index, see also Chapter 19 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_19).

Usage

rogersI(tree)

Value

rogersI returns the Rogers J index of the given tree.

Arguments

tree

A rooted binary tree in phylo format.

Author

Sophie Kersting

References

J. S. Rogers. Central Moments and Probability Distributions of Three Measures of Phylogenetic Tree Imbalance. Systematic Biology, 45(1):99-110, 1996. doi: 10.1093/sysbio/45.1.99.

Examples

Run this code
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
rogersI(tree)

Run the code above in your browser using DataLab