[Vegan-commits] r2649 - pkg/permute/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 5 05:48:34 CET 2013


Author: gsimpson
Date: 2013-11-05 05:48:34 +0100 (Tue, 05 Nov 2013)
New Revision: 2649

Modified:
   pkg/permute/R/shuffle2.R
Log:
simplify subsetting to only the within-block indices

Modified: pkg/permute/R/shuffle2.R
===================================================================
--- pkg/permute/R/shuffle2.R	2013-11-05 04:33:01 UTC (rev 2648)
+++ pkg/permute/R/shuffle2.R	2013-11-05 04:48:34 UTC (rev 2649)
@@ -62,7 +62,7 @@
         ## permute the samples within Plot strata
         if(!isTRUE(all.equal(typeW, "none"))) { ## NOTE the `!`
             ## house keeping to track permuted strata - used later
-            tab <- table(Pstrata[ind][perm])
+            tab <- table(Pstrata[perm])
             levs <- names(tab) ## levels of Plot strata in this split
 
             ## use same permutation within each level of strata?
@@ -91,7 +91,7 @@
             for(lv in levs) {
                 ## must re-order strata here on basis of out as they
                 ## may have been permuted above
-                MATCH <- Pstrata[ind][perm] == lv
+                MATCH <- Pstrata[perm] == lv
                 gr <- perm[MATCH]
                 if((n.gr <- length(gr)) > 1) {
                     tmp[which(MATCH)] <-



More information about the Vegan-commits mailing list