[Phylobase-commits] r619 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 3 23:17:54 CEST 2009


Author: francois
Date: 2009-09-03 23:17:54 +0200 (Thu, 03 Sep 2009)
New Revision: 619

Modified:
   pkg/R/setAs-Methods.R
Log:
phylo4(d) objects with unknown order are exported as phylo object with no order attribute set

Modified: pkg/R/setAs-Methods.R
===================================================================
--- pkg/R/setAs-Methods.R	2009-09-03 21:12:45 UTC (rev 618)
+++ pkg/R/setAs-Methods.R	2009-09-03 21:17:54 UTC (rev 619)
@@ -137,16 +137,16 @@
 
     ## Tree order
     ## TODO postorder != pruningwise -- though quite similar
-    attr(phy, "order") <- switch(edgeOrder(from),
-                                 postorder = "unknown",
-                                 preorder = "cladewise",
-                                 unknown = {
-                                     ## warning ??
-                                     warning("trees with unknown order may be",
-                                             " unsafe in ape")
-                                     "unknown"
-                                     },
-                                 pruningwise = "pruningwise")
+    if (edgeOrder(from) == "unknown") {
+        warning("trees with unknown order may be",
+                " unsafe in ape")
+    }
+    else {
+        attr(phy, "order") <- switch(edgeOrder(from),
+                                     postorder = "unknown",
+                                     preorder = "cladewise",
+                                     pruningwise = "pruningwise")
+    }
     phy
 })
 



More information about the Phylobase-commits mailing list