[Vegan-commits] r2140 - in branches/2.0: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 23 10:16:41 CEST 2012


Author: jarioksa
Date: 2012-04-23 10:16:41 +0200 (Mon, 23 Apr 2012)
New Revision: 2140

Modified:
   branches/2.0/R/clamtest.R
   branches/2.0/inst/ChangeLog
   branches/2.0/inst/NEWS.Rd
Log:
merge r2139: clamtest fix

Modified: branches/2.0/R/clamtest.R
===================================================================
--- branches/2.0/R/clamtest.R	2012-04-23 08:07:16 UTC (rev 2139)
+++ branches/2.0/R/clamtest.R	2012-04-23 08:16:41 UTC (rev 2140)
@@ -54,9 +54,10 @@
     #pi_i=b
     ## function to calculate test statistic from Appendix D 
     ## (Ecological Archives E092-112-A4)
+    ## coverage limit is count, not freq !!!
     testfun <- function(p_i, pi_i, C1, C2, n, m) {
-        C1 <- ifelse(p_i < coverage.limit, C1, 1)
-        C2 <- ifelse(pi_i < coverage.limit, C2, 1)
+        C1 <- ifelse(p_i*n < coverage.limit, C1, 1)
+        C2 <- ifelse(pi_i*m < coverage.limit, C2, 1)
         Var <- C1^2*(p_i*(1-p_i)/n) + uu^2*C2^2*(pi_i*(1-pi_i)/m)
         C1*p_i - C2*pi_i*uu - Zp*sqrt(Var)
     }

Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog	2012-04-23 08:07:16 UTC (rev 2139)
+++ branches/2.0/inst/ChangeLog	2012-04-23 08:16:41 UTC (rev 2140)
@@ -4,6 +4,7 @@
 
 Version 2.0-4 (opened March 9, 2012)
 
+	* merge r2139: clamtest coverage threshold fix.
 	* merge r2137: explain data transformation in pyrifos.Rd.
 	* merge r2135: print.adipart displays null model method.
 	* merge r2132: adipart bug fix: assumed constant gamma in

Modified: branches/2.0/inst/NEWS.Rd
===================================================================
--- branches/2.0/inst/NEWS.Rd	2012-04-23 08:07:16 UTC (rev 2139)
+++ branches/2.0/inst/NEWS.Rd	2012-04-23 08:16:41 UTC (rev 2140)
@@ -15,8 +15,13 @@
         (\code{weights = "unif"}) were analysed correctly.
 
       \item \code{anova(<prc-object>, by = "axis")} and other
-      \code{by} cases failed due to \file{NAMESPACE} issues.
+        \code{by} cases failed due to \file{NAMESPACE} issues.
 
+      \item \code{clamtest} wrongly used frequencies instead of the
+        counts when calculating sample coverage.  No detectable
+        differences were produced when rerunning examples from Chazdon
+        et al. 2011 and \pkg{vegan} help page.
+
       \item \code{envfit} failed with unused factor levels.
     
     }



More information about the Vegan-commits mailing list