-## reorder.phylo.R (2007-06-16)
+## reorder.phylo.R (2010-04-02)
## Internal Reordering of Trees
-## Copyright 2006-2007 Emmanuel Paradis
+## Copyright 2006-2010 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
{
order <- match.arg(order, c("cladewise", "pruningwise"))
if (!is.null(attr(x, "order")))
- if (attr(x, "order") == order) return(x)
- nb.tip <- length(x$tip.label)
+ if (attr(x, "order") == order) return(x)
nb.node <- x$Nnode
+ if (nb.node == 1) return(x)
+ nb.tip <- length(x$tip.label)
nb.edge <- dim(x$edge)[1]
neworder <- if (order == "cladewise")
.C("neworder_cladewise", as.integer(nb.tip),