avgLeafDepI {treebalance}R Documentation

Calculation of the average leaf depth index for rooted trees

Description

This function calculates the average leaf depth N(T)N(T) for a given rooted tree TT. The tree must not necessarily be binary. N(T)N(T) is defined as

N(T)=1nuVin(T)nuN(T)=\frac{1}{n}\cdot\sum_{u\in V_{in}(T)} n_u

in which nn denotes the number of leaves in TT, Vin(T)V_{in}(T) denotes the set of inner nodes of TT and nun_u denotes the number of leaves in the pending subtree that is rooted at the inner node uu. Note that N(T)N(T) can also be computed from the Sackin index S(T)S(T) as N(T)=1nS(T)N(T)=\frac{1}{n}\cdot S(T). The average leaf depth is an imbalance index.

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

For details on the average leaf depth, see also Chapter 6 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_6).

Usage

avgLeafDepI(tree)

Arguments

tree

A rooted tree in phylo format.

Value

avgLeafDepI returns the average leaf depth of the given tree.

Author(s)

Luise Kuehn

References

M. J. Sackin. "Good" and "Bad" Phenograms. Systematic Biology, 21(2):225-226, 1972. doi: 10.1093/sysbio/21.2.225.

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

Examples

tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
avgLeafDepI(tree)


[Package treebalance version 1.2.0 Index]