Finds the number of pitchforks in a tree. A pitchfork is considered to be a clade with three tips.

pitchforks(tree, normalise = FALSE)

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.

Value

An integer representing the number of pitchforks in the tree.

See also

Author

Michelle Kendall michelle.louise.kendall@gmail.com

Examples

## Find the number of pitchforks in a random tree with 20 tips:
tree <- rtree(20)
plot(tree)

pitchforks(tree)
#> [1] 3
# and the normalised pitchfork number:
pitchforks(tree, normalise=TRUE)
#> [1] 0.45

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