Learn R Programming

TreeTools (version 1.12.0)

NodeOrder: Number of edges incident to each node in a tree

Description

NodeOrder() calculates the order of each node: the number of edges incident to it in a tree. This value includes the root edge in rooted trees.

Usage

NodeOrder(x, includeAncestor = TRUE, internalOnly = FALSE)

Value

NodeOrder() returns an integer listing the order of each node; entries are named with the number of each node.

Arguments

x

A tree of class phylo, its $edge property, or a list thereof.

includeAncestor

Logical specifying whether to count edge leading to ancestral node in calculation of order.

internalOnly

Logical specifying whether to restrict to results to internal nodes, i.e. to omit leaves. Irrelevant if includeAncestor = FALSE.

See Also

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

Examples

Run this code
tree <- CollapseNode(BalancedTree(8), 12:15)
NodeOrder(tree)
plot(tree)
nodelabels(NodeOrder(tree, internalOnly = TRUE))

Run the code above in your browser using DataLab