Learn R Programming

TreeTools (version 1.12.0)

TipsInSplits: Tips contained within splits

Description

TipsInSplits() specifies the number of tips that occur within each bipartition split in a Splits object.

Usage

TipsInSplits(splits, keep.names = TRUE, smallest = FALSE, ...)

# S3 method for Splits TipsInSplits(splits, keep.names = TRUE, smallest = FALSE, ...)

# S3 method for phylo TipsInSplits(splits, keep.names = TRUE, smallest = FALSE, ...)

SplitImbalance(splits, keep.names = TRUE, ...)

# S3 method for Splits SplitImbalance(splits, keep.names = TRUE, ...)

# S3 method for phylo SplitImbalance(splits, keep.names = TRUE, ...)

Value

TipsInSplits() returns a named vector of integers, specifying the number of tips contained within each split in splits.

SplitImbalance() returns a named vector of integers, specifying the number of leaves within a split that are not "balanced" by a leaf outside it; i.e. a split that divides leaves evenly has an imbalance of zero; one that splits two tips from ten has an imbalance of 10 - 2 = 8.

Arguments

splits

Object of class Splits or phylo.

keep.names

Logical specifying whether to include the names of splits in the output.

smallest

Logical; if TRUE, return the number of leaves in the smaller bipartition.

...

Additional parameters to pass to as.Splits().

See Also

Other Splits operations: LabelSplits(), NSplits(), NTip(), PolarizeSplits(), SplitFrequency(), Splits, SplitsInBinaryTree(), TipLabels(), match.Splits, xor()

Examples

Run this code
tree <- PectinateTree(8)
splits <- as.Splits(tree)
TipsInSplits(splits)

plot(tree)
LabelSplits(tree, as.character(splits), frame = "none", pos = 3L, cex = 0.7)
LabelSplits(tree, TipsInSplits(splits), unit = " tips", frame = "none",
            pos = 1L)

Run the code above in your browser using DataLab