[Vegan-commits] r1943 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 10 08:13:04 CEST 2011


Author: jarioksa
Date: 2011-10-10 08:13:03 +0200 (Mon, 10 Oct 2011)
New Revision: 1943

Modified:
   pkg/vegan/R/permutest.cca.R
Log:
kluge to get back 'strata' in permutest.cca

Modified: pkg/vegan/R/permutest.cca.R
===================================================================
--- pkg/vegan/R/permutest.cca.R	2011-10-10 05:48:10 UTC (rev 1942)
+++ pkg/vegan/R/permutest.cca.R	2011-10-10 06:13:03 UTC (rev 1943)
@@ -107,7 +107,12 @@
     seed <- get(".Random.seed", envir = .GlobalEnv, inherits = FALSE)
     ## permutations
     if (length(permutations) == 1) {
-        permutations <- shuffleSet(N, permutations)
+        if (is.null(strata))
+            permutations <- shuffleSet(N, permutations)
+        else
+            permutations <-
+                t(sapply(1:permutations,
+                         function(x) vegan:::permuted.index(N, strata=strata))) 
     }
     nperm <- nrow(permutations)
     if (parallel > 1 && getRversion() >= "2.14" && require(parallel)) {



More information about the Vegan-commits mailing list