[Vegan-commits] r2139 - in pkg/vegan: R inst

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


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

Modified:
   pkg/vegan/R/clamtest.R
   pkg/vegan/inst/ChangeLog
Log:
Squashed commit of the following:

commit 1ac611ee9e29ee427bd1aa411531a50fa32a6768
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date:   Mon Apr 23 10:54:02 2012 +0300

    Squashed commit of the following (clamtest fix):

    commit 30dc4e2690b6ce20adfb43709e18349bab9e63a3
    Merge: b5ba108 947e42d
    Author: Jari Oksanen <jari.oksanen at oulu.fi>
    Date:   Mon Apr 23 10:51:36 2012 +0300

        Merge commit '947e42d' into test

    commit 947e42d71c27895dec8af983201619441af42341
    Author: psolymos <psolymos at gmail.com>
    Date:   Sat Apr 21 23:23:14 2012 -0600

        clamtest: coverage calculation fixed

Modified: pkg/vegan/R/clamtest.R
===================================================================
--- pkg/vegan/R/clamtest.R	2012-04-22 06:13:38 UTC (rev 2138)
+++ pkg/vegan/R/clamtest.R	2012-04-23 08:07:16 UTC (rev 2139)
@@ -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: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-04-22 06:13:38 UTC (rev 2138)
+++ pkg/vegan/inst/ChangeLog	2012-04-23 08:07:16 UTC (rev 2139)
@@ -4,6 +4,11 @@
 
 Version 2.1-14 (opened March 9, 2012)
 
+  * clamtest: wrongly used frequencies instead of the counts
+  when calculating sample coverage to test x < coverage.limit. 
+  No detectable differences were produced when rerunning 
+  examples from Chazdon et al. 2011 and vegan help page.
+
 	* Opened a new version with the CRAN release of vegan 2.0-3 on
 	March 3, 2012.
 



More information about the Vegan-commits mailing list