[Phylobase-commits] r557 - in pkg: R man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 21 20:53:01 CEST 2009


Author: bbolker
Date: 2009-08-21 20:52:59 +0200 (Fri, 21 Aug 2009)
New Revision: 557

Modified:
   pkg/R/checkdata.R
   pkg/man/check.phylo4.Rd
   pkg/tests/misctests.Rout.save
   pkg/tests/phylotorture.Rout.save
   pkg/tests/testprune.Rout.save
Log:
 changed "multroot" to "multiroot" in checkdata.R;
 updated test output appropriately; update docs
for checkRoot




Modified: pkg/R/checkdata.R
===================================================================
--- pkg/R/checkdata.R	2009-08-21 18:29:43 UTC (rev 556)
+++ pkg/R/checkdata.R	2009-08-21 18:52:59 UTC (rev 557)
@@ -11,7 +11,7 @@
 }
 
 checkTree <- function(object,
-                      warn=c("retic","singleton","multroot"),
+                      warn=c("retic","singleton","multiroot"),
                       err=NULL) {
 
     ## case of empty phylo4 object
@@ -43,7 +43,7 @@
     if(length(object at tip.label) != ntips)
       return("number of tip labels not consistent with number of tips")
     E <- edges(object)
-    tips <- sort(E[,2][!E[,2] %in% E[,1]])
+    tips <- unique(sort(E[,2][!E[,2] %in% E[,1]]))
     nodes <- unique(sort(c(E)))
     intnodes <- nodes[!nodes %in% tips]
     roots <- E[which(is.na(E[,1])),2]
@@ -150,9 +150,9 @@
 
     if (nRoots>1) {
         currmsg <- "tree has more than one root"
-        if ("multroot" %in% err)
+        if ("multiroot" %in% err)
           return(currmsg)
-        if ("multroot" %in% warn)
+        if ("multiroot" %in% warn)
           msg <- c(msg,currmsg)
       }
     if (any(nDesc==1)) {

Modified: pkg/man/check.phylo4.Rd
===================================================================
--- pkg/man/check.phylo4.Rd	2009-08-21 18:29:43 UTC (rev 556)
+++ pkg/man/check.phylo4.Rd	2009-08-21 18:52:59 UTC (rev 557)
@@ -7,13 +7,20 @@
 }
 \usage{
 checkPhylo4(object)
-checkTree(object,warn="retic",err=NULL)
+checkTree(object,
+             warn=c("retic","singleton","multiroot"),
+             err=NULL)
 }
 \arguments{
   \item{object}{A prospective S4 object}
   \item{warn}{a character vector listing phenomena to warn about:
-    current options are "poly" and "retic"}
-  \item{err}{a character vector listing phenomena to trigger errors}
+    current options are [\code{"poly"} (polytomies),
+    \code{"retic"} (reticulations),
+    \code{"singleton"} ("singleton" nodes, i.e.
+    nodes with a single descendant), \code{"multiroot"}
+    (multiple roots) ]}
+  \item{err}{a character vector listing phenomena to trigger errors:
+    choices as above}
 }
 \value{
   As required by \code{\link[methods]{validObject}}, returns an

Modified: pkg/tests/misctests.Rout.save
===================================================================
--- pkg/tests/misctests.Rout.save	2009-08-21 18:29:43 UTC (rev 556)
+++ pkg/tests/misctests.Rout.save	2009-08-21 18:52:59 UTC (rev 557)
@@ -83,8 +83,8 @@
         mean         : 0.2116037 
         variance     : 0.01503145 
         distribution :
-   Min. 1st Qu.  Median 3rd Qu.    Max. 
-0.07552 0.10370 0.23040 0.27250 0.38530 
+   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
+0.07552 0.10370 0.23040 0.21160 0.27250 0.38530 
 
 Comparative data:
 
@@ -131,8 +131,8 @@
         mean         : 0.1988313 
         variance     : 0.0167175 
         distribution :
-   Min. 1st Qu.  Median 3rd Qu.    Max. 
-0.04857 0.07552 0.20610 0.28460 0.38530 
+   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
+0.04857 0.07552 0.20610 0.19880 0.28460 0.38530 
 
 Comparative data:
 
@@ -334,4 +334,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  3.464   0.076   3.520 
+  3.396   0.064   3.490 

Modified: pkg/tests/phylotorture.Rout.save
===================================================================
--- pkg/tests/phylotorture.Rout.save	2009-08-21 18:29:43 UTC (rev 556)
+++ pkg/tests/phylotorture.Rout.save	2009-08-21 18:52:59 UTC (rev 557)
@@ -40,8 +40,6 @@
   longer object length is not a multiple of shorter object length
 3: In tips == 1:ntips :
   longer object length is not a multiple of shorter object length
-4: In tips == 1:ntips :
-  longer object length is not a multiple of shorter object length
 > OKvals <- sapply(p1,class)!="try-error"
 > table(sapply(p1[!OKvals],as.character))
 
@@ -94,7 +92,7 @@
 > 
 > try(as(broke1, "phylo4") -> tree, silent=TRUE)   # makes a phylo4  object with no warning
 Warning message:
-In checkTree(object) : tree is reticulated:tree contains singleton nodes
+In checkTree(object) : tree contains singleton nodes
 > try(phylo4(broke1$edge), silent=TRUE)    # constructor makes a phylo4 object with no warning
   label node ancestor edge.length node.type
 6  <NA>    6       NA          NA  internal
@@ -107,10 +105,8 @@
 4    T4    4        9          NA       tip
 5    T5    5        9          NA       tip
 Warning messages:
-1: In checkTree(object) :
-  tree is reticulated:tree contains singleton nodes
-2: In checkTree(object) :
-  tree is reticulated:tree contains singleton nodes
+1: In checkTree(object) : tree contains singleton nodes
+2: In checkTree(object) : tree contains singleton nodes
 > ## error message comes from ape, not phylo? -- AND
 > ##   error is about singles, not disconnected nodes
 > ## print(try(plot(tree), silent=TRUE ))  ## pdc couldn't get this to work, so temporarily commenting
@@ -202,4 +198,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.680   0.064   1.733 
+  1.744   0.044   1.807 

Modified: pkg/tests/testprune.Rout.save
===================================================================
--- pkg/tests/testprune.Rout.save	2009-08-21 18:29:43 UTC (rev 556)
+++ pkg/tests/testprune.Rout.save	2009-08-21 18:52:59 UTC (rev 557)
@@ -40,8 +40,8 @@
         mean         : 0.2116037 
         variance     : 0.01503145 
         distribution :
-   Min. 1st Qu.  Median 3rd Qu.    Max.    NA's 
-0.07552 0.10370 0.23040 0.27250 0.38530 1.00000 
+   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
+0.07552 0.10370 0.23040 0.21160 0.27250 0.38530 
 
 Comparative data:
 
@@ -77,4 +77,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.162   0.047   1.203 
+  1.700   0.068   1.744 



More information about the Phylobase-commits mailing list