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

Renumber

Renumber a tree's nodes and tips


Description

Renumber() numbers the nodes and tips in a tree to conform with the phylo standards.

Usage

Renumber(tree)

Arguments

tree

A tree of class phylo.

Details

The 'ape' class phylo is not formally defined, but expects trees' internal representation to conform to certain principles: for example, nodes should be numbered sequentially, with values increasing away from the root.

Renumber() attempts to reformat any tree into a representation that will not cause 'ape' functions to produce unwanted results or to crash R.

Value

Renumber() returns a tree of class phylo, numbered in a Cladewise fashion consistent with the expectations of 'ape' functions.

Author(s)

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

See Also

Preorder() provides a faster and simpler alternative, but also rotates nodes.

Examples

tree <- RandomTree(letters[1:10])
Renumber(tree)

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.