[Phylobase-commits] r653 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 17 03:52:17 CEST 2009


Author: pdc
Date: 2009-09-17 03:52:17 +0200 (Thu, 17 Sep 2009)
New Revision: 653

Modified:
   pkg/R/methods-phylo4.R
Log:
be sure tree is rooted before trying to reorder, fixes bug #658

Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-09-16 20:15:45 UTC (rev 652)
+++ pkg/R/methods-phylo4.R	2009-09-17 01:52:17 UTC (rev 653)
@@ -529,7 +529,9 @@
 orderIndex <- function(x, order=c("preorder", "postorder")) {
 
     order <- match.arg(order)
-
+    if(!isRooted(x)){
+        stop("Tree must be rooted to reorder")
+    }
     ## get a root node free edge matrix
     edge <- edges(x)[!is.na(edges(x)[, 1]), ]
     ## Sort edges -- ensures that starting order of edge matrix doesn't



More information about the Phylobase-commits mailing list