Renumber()
numbers the nodes and tips in a tree to conform with the
phylo
standards.
Renumber(tree)
A tree of class phylo
.
Renumber()
returns a tree of class phylo
, numbered in a
Cladewise fashion consistent with the expectations of ape functions.
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.
Preorder()
provides a faster and simpler alternative, but also
rotates nodes.
Other tree manipulation:
AddTip()
,
CollapseNode()
,
ConsensusWithout()
,
DropTip()
,
EnforceOutgroup()
,
ImposeConstraint()
,
KeptPaths()
,
KeptVerts()
,
LeafLabelInterchange()
,
MakeTreeBinary()
,
RenumberTips()
,
RenumberTree()
,
RootTree()
,
SortTree()
,
Subtree()
,
TrivialTree
tree <- RandomTree(letters[1:10])
Renumber(tree)
#>
#> Phylogenetic tree with 10 tips and 8 internal nodes.
#>
#> Tip labels:
#> e, h, d, g, j, b, ...
#>
#> Unrooted; no branch lengths.