[Phylobase-commits] r114 - in pkg: R tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 22 19:09:45 CET 2008


Author: jombart
Date: 2008-02-22 19:09:45 +0100 (Fri, 22 Feb 2008)
New Revision: 114

Modified:
   pkg/R/prune.R
   pkg/tests/plottest.R
Log:
Fixed incorrect node.label returned by "prune".


Modified: pkg/R/prune.R
===================================================================
--- pkg/R/prune.R	2008-02-22 17:46:31 UTC (rev 113)
+++ pkg/R/prune.R	2008-02-22 18:09:45 UTC (rev 114)
@@ -37,7 +37,7 @@
                    root.edge = 0,...) {
             oldnodelabels <- phy at node.label
             ## need unique labels to match data correctly
-            tags <- paste("N",1:nNodes(phy),sep="")
+            tags <- .genlab("N",nNodes(phy))
             phy at node.label <- tags
             if (hasNodeData(phy)) {
               rownames(phy at node.data) <- phy at node.label
@@ -51,7 +51,7 @@
               phytr at node.data <- phy at node.data[m1,,drop=FALSE]
               rownames(phytr at node.data) <- phytr at node.label
             }
-            phytr at node.label <- oldnodelabels
+            ## phytr at node.label <- oldnodelabels
             phytr
           })
 

Modified: pkg/tests/plottest.R
===================================================================
--- pkg/tests/plottest.R	2008-02-22 17:46:31 UTC (rev 113)
+++ pkg/tests/plottest.R	2008-02-22 18:09:45 UTC (rev 114)
@@ -27,12 +27,7 @@
 g3 = subset(g2,tips.exclude=c("fuliginosa","fortis","magnirostris",
                  "conirostris","scandens"))
 plot(extract.tree(g3))  ## phylo4
-t1 <- try(plot(g3),silent=TRUE)
-## no error but mistakes in node labels
-## because extract.tree has uncorrect @node.label (see below). -- TJ
-nNodes(g2)
-nNodes(g3)
-identical(g2 at node.label,g3 at node.label)
+plot(g3,ratio=.5)
 
 
 ## Playing with new ways of plotting



More information about the Phylobase-commits mailing list