| NDescendants {TreeTools} | R Documentation |
Count descendants for each node in a tree
Description
NDescendants() counts the number of nodes (including leaves) directly
descended from each node in a tree.
Usage
NDescendants(tree)
Arguments
tree |
A tree of class |
Value
NDescendants() returns an integer listing the number of direct
descendants (leaves or internal nodes) for each node in a tree.
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
See Also
Other tree navigation:
AncestorEdge(),
CladeSizes(),
DescendantEdges(),
EdgeAncestry(),
EdgeDistances(),
ListAncestors(),
MRCA(),
MatchEdges(),
NodeDepth(),
NodeNumbers(),
NodeOrder(),
RootNode()
Examples
tree <- CollapseNode(BalancedTree(8), 12:15)
NDescendants(tree)
plot(tree)
nodelabels(NDescendants(tree))
[Package TreeTools version 1.12.0 Index]