[Phylobase-commits] r628 - in pkg: R inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 9 07:18:39 CEST 2009


Author: regetz
Date: 2009-09-09 07:18:38 +0200 (Wed, 09 Sep 2009)
New Revision: 628

Modified:
   pkg/R/methods-phylo4.R
   pkg/inst/unitTests/runit.methods-phylo4.R
Log:
changed hasEdgeLabels to work like hasEdgeLength; reinstated unit test


Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-09-09 04:48:30 UTC (rev 627)
+++ pkg/R/methods-phylo4.R	2009-09-09 05:18:38 UTC (rev 628)
@@ -344,7 +344,7 @@
 
 ### Edge labels
 setMethod("hasEdgeLabels", "phylo4", function(x) {
-    length(x at edge.label) > 0
+    !all(is.na(x at edge.label))
 })
 
 # return edge labels in order by edgeIds (same order as edge matrix)

Modified: pkg/inst/unitTests/runit.methods-phylo4.R
===================================================================
--- pkg/inst/unitTests/runit.methods-phylo4.R	2009-09-09 04:48:30 UTC (rev 627)
+++ pkg/inst/unitTests/runit.methods-phylo4.R	2009-09-09 05:18:38 UTC (rev 628)
@@ -163,8 +163,7 @@
 test.hasEdgeLabels.phylo4 <- function() {
   checkTrue(hasEdgeLabels(phy))
   phy at edge.label <- NA_character_
-# TODO: fix hasEdgeLabels
-#  checkTrue(!hasEdgeLabels(phy))
+  checkTrue(!hasEdgeLabels(phy))
 }
 
 test.edgeLabels.phylo4 <- function() {



More information about the Phylobase-commits mailing list