R: Count descendants for each node in a tree

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 `phylo`.

### 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()`, `NodeDepth()`, `NodeOrder()`, `NonDuplicateRoot()`, `RootNode()`

### Examples

    tree <- CollapseNode(BalancedTree(8), 12:15)
    NDescendants(tree)
    plot(tree)
    nodelabels(NDescendants(tree))

[Package TreeTools version 1.7.2 Index]