reorder.phylo

0th

Percentile

Internal Reordering of Trees

This function changes the internal structure of a phylogeny stored as an object of class "phylo". The tree returned is the same than the one input, but the ordering of the edges could be different.

Keywords
manip
Usage
## S3 method for class 'phylo':
reorder(x, order = "cladewise", ...)
Arguments
x
an object of class "phylo".
order
a character string: either "cladewise" (the default), or "pruningwise", or any unambiguous abbreviation of these.
...
further arguments passed to or from other methods.
Details

Because in a tree coded as an object of class "phylo" each branch is represented by a row in the element `edge', there is an arbitrary choice for the ordering of these rows. reorder allows to reorder these rows according to two rules: in the "cladewise" order each clade is formed by a series of contiguous rows; this is the order returned by read.tree. In the "pruningwise" order, rows are arranged so that ``pruning'' the tree (or post-order tree traversal) can be done by descending along the rows of `edge'. The possible multichotomies and branch lengths are preserved.

Value

  • an object of class "phylo".

See Also

read.tree to read tree files in Newick format, reorder for the generic function

Aliases
  • reorder.phylo
Examples
data(bird.families)
tr <- reorder(bird.families, "p")
all.equal(bird.families, tr) # uses all.equal.phylo actually
all.equal.list(bird.families, tr) # bypasses the generic
Documentation reproduced from package ape, version 2.1-1, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.