Learn R Programming

phyloTop (version 2.1.2)

cherries: Cherry number

Description

Finds the number of cherries in a tree. A cherry is considered to be a pair of sister tips.

Usage

cherries(tree, normalise = FALSE)

Value

An integer representing the number of cherries in the tree.

Arguments

tree

a tree of class phylo or phylo4. The tree should be binary and rooted; if not it will be coerced into a binary rooted tree using multi2di, if possible.

normalise

option to normalise the result, default is FALSE.

Author

Michelle Kendall michelle.louise.kendall@gmail.com

See Also

configShow

Examples

Run this code
## Find the number of cherries in a random tree with 10 tips:
tree <- rtree(10)
plot(tree)
cherries(tree)
# and the normalised cherry number:
cherries(tree, normalise=TRUE)

## Note that the function configShow can be used to highlight the cherries in the tree:
configShow(tree, 2, edge.width=2)


Run the code above in your browser using DataLab