3 \title{Internal Reordering of Trees}
5 This function changes the internal structure of a phylogeny stored as
6 an object of class \code{"phylo"}. The tree returned is the same than
7 the one input, but the ordering of the edges could be different.
10 \method{reorder}{phylo}(x, order = "cladewise", ...)
13 \item{x}{an object of class \code{"phylo"}.}
14 \item{order}{a character string: either \code{"cladewise"} (the
15 default), or \code{"pruningwise"}, or any unambiguous abbreviation
17 \item{\dots}{further arguments passed to or from other methods.}
20 Because in a tree coded as an object of class \code{"phylo"} each
21 branch is represented by a row in the element `edge', there is an
22 arbitrary choice for the ordering of these rows. \code{reorder} allows
23 to reorder these rows according to two rules: in the
24 \code{"cladewise"} order each clade is formed by a series of
25 contiguous rows; this is the order returned by
26 \code{\link{read.tree}}. In the \code{"pruningwise"} order, rows are
27 arranged so that ``pruning'' the tree (or post-order tree traversal)
28 can be done by descending along the rows of `edge'. The possible
29 multichotomies and branch lengths are preserved.
32 an object of class \code{"phylo"}.
34 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
36 \code{\link{read.tree}} to read tree files in Newick format,
37 \code{\link[stats]{reorder}} for the generic function
41 tr <- reorder(bird.families, "p")
42 all.equal(bird.families, tr) # uses all.equal.phylo actually
43 all.equal.list(bird.families, tr) # bypasses the generic