The reorder
method takes a phylo4
or phylo4d
tree and orders the edge matrix (i.e. edges(x)
) in the
requested traversal order. Currently only two orderings are
permitted, and both require rooted trees. In postorder
, a
node's descendants come before that node, thus the root, which is
ancestral to all nodes, comes last. In preorder
, a node is
visited before its descendants, thus the root comes first.