Learn R Programming

TreeTools (version 2.0.0)

Cherries: 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 phylo Cherries(tree, nTip = NTip(tree))

# S3 method for numeric Cherries(tree, nTip)

Value

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

Arguments

tree

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

nTip

Number of leaves in tree.

See Also

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