[Vegan-commits] r2838 - in pkg/permute: . R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 23 17:11:23 CET 2014


Author: gsimpson
Date: 2014-01-23 17:11:23 +0100 (Thu, 23 Jan 2014)
New Revision: 2838

Modified:
   pkg/permute/DESCRIPTION
   pkg/permute/R/allPerms.R
   pkg/permute/inst/ChangeLog
Log:
allPerms was not using the original row indices in the case of random permutation within blocks

Modified: pkg/permute/DESCRIPTION
===================================================================
--- pkg/permute/DESCRIPTION	2014-01-21 11:53:11 UTC (rev 2837)
+++ pkg/permute/DESCRIPTION	2014-01-23 16:11:23 UTC (rev 2838)
@@ -1,6 +1,6 @@
 Package: permute
 Title: Functions for generating restricted permutations of data
-Version: 0.8-1
+Version: 0.8-2
 Date: $Date$
 Authors at R: c(person(given = "Gavin L.", family = "Simpson",
                     email = "ucfagls at gmail.com",

Modified: pkg/permute/R/allPerms.R
===================================================================
--- pkg/permute/R/allPerms.R	2014-01-21 11:53:11 UTC (rev 2837)
+++ pkg/permute/R/allPerms.R	2014-01-23 16:11:23 UTC (rev 2838)
@@ -109,6 +109,9 @@
                           series = allSeries(n, nperms, mirrorW),
                           grid = allGrid(n, nperms, dimW[1],
                           dimW[2], mirrorW, constantW))
+            ## use res to index the original observation indices in
+            ## this group
+            res[] <- obs[res]
         } else {
             ## permuting within plots
             tab <- table(strataP)

Modified: pkg/permute/inst/ChangeLog
===================================================================
--- pkg/permute/inst/ChangeLog	2014-01-21 11:53:11 UTC (rev 2837)
+++ pkg/permute/inst/ChangeLog	2014-01-23 16:11:23 UTC (rev 2838)
@@ -2,6 +2,13 @@
 
 permute ChangeLog
 
+Version 0.8-2
+
+	* allPerms: with free permutations *within* blocks, `allPerms()`
+	was not returning the indices in the original data but in the
+	permutation indices within block.
+	Reported by: Joris Meys
+
 Version 0.8-1
 
 	* setBlocks: get block name before doing anything so that you



More information about the Vegan-commits mailing list