NDescendants()
counts the number of nodes (including leaves) directly
descended from each node in a tree.
Arguments
- tree
A tree of class
phylo
.
Value
NDescendants()
returns an integer listing the number of direct
descendants (leaves or internal nodes) for each node in a tree.
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)
#> [1] 5 3 2
plot(tree)
nodelabels(NDescendants(tree))