TreeTools (version 1.4.1)

SplitsInBinaryTree: Maximum splits in an n-leaf tree

Description

SplitsInBinaryTree() is a convenience function to calculate the number of splits in a fully-resolved (binary) tree with n leaves.

Usage

SplitsInBinaryTree(tree)

# S3 method for list SplitsInBinaryTree(tree)

# S3 method for multiPhylo SplitsInBinaryTree(tree)

# S3 method for numeric SplitsInBinaryTree(tree)

# S3 method for `NULL` SplitsInBinaryTree(tree)

# S3 method for default SplitsInBinaryTree(tree)

# S3 method for Splits SplitsInBinaryTree(tree)

# S3 method for phylo SplitsInBinaryTree(tree)

Arguments

tree

An object of a supported format that represents a tree or set of trees, from which the number of leaves will be calculated.

Value

SplitsInBinaryTree() returns an integer vector detailing the number of unique non-trivial splits in a binary tree with n leaves.

See Also

Other tree properties: ConsensusWithout(), NSplits(), NTip(), TipLabels(), TreeIsRooted()

Other Splits operations: NSplits(), NTip(), TipLabels(), TipsInSplits(), as.Splits(), match()

Examples

Run this code
# NOT RUN {
tree <- TreeTools::BalancedTree(8)
SplitsInBinaryTree(tree)
SplitsInBinaryTree(TreeTools::as.Splits(tree))
SplitsInBinaryTree(8)
SplitsInBinaryTree(list(tree, tree))
# }

Run the code above in your browser using DataCamp Workspace