[Vegan-commits] r273 - in pkg: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 20 17:27:59 CET 2008


Author: gsimpson
Date: 2008-03-20 17:27:59 +0100 (Thu, 20 Mar 2008)
New Revision: 273

Modified:
   pkg/R/numPerms.R
   pkg/inst/ChangeLog
Log:
Return correct number of permutations in the particular case of type=grid and mirror=TRUE with ncol=2

Modified: pkg/R/numPerms.R
===================================================================
--- pkg/R/numPerms.R	2008-03-20 10:50:06 UTC (rev 272)
+++ pkg/R/numPerms.R	2008-03-20 16:27:59 UTC (rev 273)
@@ -21,8 +21,12 @@
             exp(lfactorial(nobs))
     } else if(control$type %in% c("series","grid")) {
         multi <- 2
-        if(control$type == "grid")
-            multi <- 4
+        if(control$type == "grid") {
+            if(control$ncol == 2)
+                multi <- 2
+            else
+                multi <- 4
+        }
         if(use.strata) {
             if(control$mirror) {
                 if(control$constant)

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-03-20 10:50:06 UTC (rev 272)
+++ pkg/inst/ChangeLog	2008-03-20 16:27:59 UTC (rev 273)
@@ -14,7 +14,9 @@
 	in 'betadisper'.
 
 	* numPerms: Was incorrectly calculating the number of permutations
-	when permuting levels of strata was performed.
+	when permuting levels of strata was performed. numPerms was also
+	incorrectly reporting too many permutations in the particular
+	case of type="grid" and mirror=TRUE with ncol=2.
 
 	* permuted.index2: When permuting levels of 'strata'
 	(type = "strata"), permuted.index2 was shuffling both the levels 



More information about the Vegan-commits mailing list