cherryI | R Documentation |

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., 2023).

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

```
cherryI(tree)
```

`tree` |
A rooted tree in phylo format. |

`cherryI`

returns the cherry index of the given tree.

Sophie Kersting

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.

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.