TreeTools (version 0.1.3)

RenumberTree: Renumber a tree in preorder

Description

Wrapper for the C function preorder_edges_and_nodes, which renumbers internal nodes and orders edges in preorder, in an order guaranteed to be identical for any tree of an equivalent topology. At each node, child edges are arranged from left to right according to the lowest-numbered tip in the subtree subtended by each edge.

Usage

RenumberTree(parent, child)

RenumberEdges(parent, child, nEdge = length(parent))

Arguments

parent

the first column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 1].

child

the second column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 2].

Value

RenumberTree returns an edge matrix for a tree of class phylo following the usual preorder convention for edge and node numbering.

RenumberEdges returns a list whose two entries correspond to the new parent and child vectors.

Functions

  • RenumberEdges: Returns in list format

See Also

SortTree

Other C wrappers: Cladewise, Neworder