Cherries: Count cherries in a tree

View source: R/Cherries.R

CherriesR Documentation

Count cherries in a tree

Description

Cherries() counts the number of vertices in a binary tree whose children are both leaves.

Usage

Cherries(tree, nTip)

## S3 method for class 'phylo'
Cherries(tree, nTip = NTip(tree))

## S3 method for class 'numeric'
Cherries(tree, nTip)

Arguments

tree

A binary tree, of class phylo; or a matrix corresponding to its edge matrix.

nTip

Number of leaves in tree.

Value

Cherries() returns an integer specifying the number of nodes whose children are both leaves.

Equations for the number of cherries expected under uniform and Yule tree models are derived by \insertCiteMcKenzie2000;textualTreeTools.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

References

\insertAllCited

See Also

Other tree properties: ConsensusWithout(), EdgeRatio(), LongBranch(), MatchEdges(), NSplits(), NTip(), NodeNumbers(), PathLengths(), SplitsInBinaryTree(), TipLabels(), TreeIsRooted(), Treeness()


TreeTools documentation built on April 23, 2026, 5:06 p.m.