Learn R Programming

TreeTools (version 1.12.0)

TreesMatchingTree: Number of trees containing a tree

Description

TreesMatchingTree() calculates the number of unrooted binary trees that are consistent with a tree topology on the same leaves.

Usage

TreesMatchingTree(tree)

LnTreesMatchingTree(tree)

Log2TreesMatchingTree(tree)

Value

TreesMatchingTree() returns a numeric specifying the number of unrooted binary trees that contain all the edges present in the input tree.

LnTreesMatchingTree() gives the natural logarithm of this number.

Arguments

tree

A tree of class phylo.

Details

Remember to unroot a tree first if the position of its root is arbitrary.

See Also

Other tree information functions: CladisticInfo(), NRooted()

Examples

Run this code
partiallyResolvedTree <- CollapseNode(BalancedTree(8), 12:15)
TreesMatchingTree(partiallyResolvedTree)
LnTreesMatchingTree(partiallyResolvedTree)

# Number of rooted trees:
rootedTree <- AddTip(partiallyResolvedTree, where = 0)
TreesMatchingTree(partiallyResolvedTree)

Run the code above in your browser using DataLab