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.
RenumberTree(parent, child)RenumberEdges(parent, child, nEdge = length(parent))
Integer vector corresponding to the first column of the edge
matrix of a tree of class phylo
, i.e. tree$edge[, 1]
Integer vector corresponding to the second column of the edge
matrix of a tree of class phylo
, i.e. tree$edge[, 2]
.
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.