cherryI: Calculation of the cherry index for rooted trees

Description Usage Arguments Value Author(s) References Examples

View source: R/cherryI.R

Description

This function calculates the cherry index ChI(T) for a given rooted tree T. The tree must not necessarily be binary. ChI(T) is defined as the number of cherries in the tree. A cherry is a pair of leaves that have the same direct ancestor. Note, if a vertex u has x leaves as direct descendants, the number of cherries induced by u is binom(x,2).

The cherry index does not fulfill the definition of an (im)balance index given in "Tree balance indices: a comprehensive survey" (Fischer et al., 2021).

Usage

1
cherryI(tree)

Arguments

tree

A rooted tree in phylo format.

Value

cherryI returns the cherry index of the given tree.

Author(s)

Sophie Kersting

References

A. McKenzie and M. Steel. Distributions of cherries for two models of trees. Mathematical Biosciences, 164(1):81-92, 2000. doi: 10.1016/s0025-5564(99)00060-7.

Examples

1
2
3
4
5
6
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
cherryI(tree)
tree <- ape::read.tree(text="((,),((((,),),),(,)));")
cherryI(tree)
tree <- ape::read.tree(text="((,,,),(,,));")
cherryI(tree)

treebalance documentation built on Oct. 17, 2021, 5:06 p.m.