Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NodeOrder

Order of each node in a tree


Description

NodeOrder() calculates the number of edges incident to each node in a tree. Includes the root edge in rooted trees.

Usage

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

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.

Value

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

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

Examples

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

TreeTools

Create, Modify and Analyse Phylogenetic Trees

v1.4.4
GPL (>= 3)
Authors
Martin R. Smith [aut, cre, cph] (<https://orcid.org/0000-0001-5660-1727>), Emmanuel Paradis [cph] (<https://orcid.org/0000-0003-3092-2199>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.