Learn R Programming

treebalance (version 1.2.0)

B1I: Calculation of the B1 index for rooted trees

Description

This function calculates the \(B1\) index \(B1(T)\) for a given rooted tree \(T\). The tree must not necessarily be binary. \(B1(T)\) is defined as $$B1(T)=\sum_{u\in V_{in}(T)\setminus\{\rho\}} h(T_u)^{-1}$$ in which \(V_{in}(T)\setminus\{\rho\}\) denotes the set of inner vertices of \(T\) without the root, and \(h(T_u)\) denotes the height of the pending subtree rooted at \(u\). When restricted to binary trees, the \(B1\) index is a balance index. For arbitrary trees it does not fulfill the definition of an (im)balance index.

For \(n=1\) the function returns \(B1(T)=0\) and a warning.

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

Usage

B1I(tree)

Value

B1I returns the B1 index of the given tree.

Arguments

tree

A rooted tree in phylo format.

Author

Sophie Kersting

References

K.-T. Shao and R. R. Sokal. Tree Balance. Systematic Zoology, 39(3):266, 1990.
doi: 10.2307/2992186.

Examples

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

Run the code above in your browser using DataLab