Learn R Programming

TreeTools (version 1.12.0)

CladeSizes: Clade sizes

Description

CladeSizes() reports the number of nodes in each clade in a tree.

Usage

CladeSizes(tree, internal = FALSE, nodes = NULL)

Value

CladeSizes() returns the number of nodes (including leaves) that are descended from each node, not including the node itself.

Arguments

tree

A tree of class phylo.

internal

Logical specifying whether internal nodes should be counted towards the size of each clade.

nodes

Integer specifying indices of nodes at the base of clades whose sizes should be returned. If unspecified, counts will be provided for all nodes (including leaves).

See Also

Other tree navigation: AncestorEdge(), DescendantEdges(), EdgeAncestry(), EdgeDistances(), ListAncestors(), MRCA(), MatchEdges(), NDescendants(), NodeDepth(), NodeNumbers(), NodeOrder(), RootNode()

Examples

Run this code
tree <- BalancedTree(6)
plot(tree)
ape::nodelabels()
CladeSizes(tree, nodes = c(1, 8, 9))

Run the code above in your browser using DataLab