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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 12 21:04:06 CEST 2010


Author: jarioksa
Date: 2010-10-12 21:04:06 +0200 (Tue, 12 Oct 2010)
New Revision: 1331

Modified:
   pkg/vegan/R/oecosimu.R
   pkg/vegan/inst/ChangeLog
Log:
take care that primary statistic is ealuated with binary data in binary null models

Modified: pkg/vegan/R/oecosimu.R
===================================================================
--- pkg/vegan/R/oecosimu.R	2010-10-12 18:41:06 UTC (rev 1330)
+++ pkg/vegan/R/oecosimu.R	2010-10-12 19:04:06 UTC (rev 1331)
@@ -20,8 +20,11 @@
         method <- "custom"
     }
     quant <- method %in% c("r2dtable", "custom")
+    ## binarize data with binary null models before getting statistics
+    if (!quant)
+        comm <- ifelse(comm > 0, 1, 0)
+    ind <- nestfun(comm, ...)
 
-    ind <- nestfun(comm, ...)
     if (is.list(ind))
         indstat <- ind[[statistic]]
     else
@@ -31,7 +34,6 @@
 
     ## permutation for binary data
     if (!quant) {
-        comm <- ifelse(comm > 0, 1, 0)
         if (method %in% c("swap", "tswap")){
             checkbrd <- 1
             if (method == "tswap") {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-10-12 18:41:06 UTC (rev 1330)
+++ pkg/vegan/inst/ChangeLog	2010-10-12 19:04:06 UTC (rev 1331)
@@ -11,6 +11,11 @@
 	cases where these are produced by the function to evaluate
 	statistics.
 
+	* oecosimu: takes care that the statistic is evaluated with binary
+	data when null models are binary. This was a one-year old bug
+	introduced in rev 967 on Aug 31, 2009. Previous time this bug was
+	corrected in rev 438 on June 28, 2008.
+
 	* nestednodf: Gustavo Carvalho sent a new upgraded version which
 	also implements a new quantitative method of Almeida-Neto & Ulrich
 	(Env Mod Software, in press; 2010). Based on feature request #1097



More information about the Vegan-commits mailing list