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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 21 17:42:33 CET 2013


Author: gsimpson
Date: 2013-11-21 17:42:32 +0100 (Thu, 21 Nov 2013)
New Revision: 2727

Modified:
   pkg/permute/R/check.R
Log:
reduce length of messages; switch from 'update' to 'set-methods'

Modified: pkg/permute/R/check.R
===================================================================
--- pkg/permute/R/check.R	2013-11-21 16:36:36 UTC (rev 2726)
+++ pkg/permute/R/check.R	2013-11-21 16:42:32 UTC (rev 2727)
@@ -67,27 +67,24 @@
 
     ## check if number requested permutations exceeds max possible
     if(getNperm(control) > num.pos) {
-        control <- update(control, nperm = num.pos, maxperm = num.pos,
-                          complete = TRUE)
-        control$call[["nperm"]] <- eval(control$call[["nperm"]])
-        control$call[["maxperm"]] <- eval(control$call[["maxperm"]])
-        message("Requested number of permutations larger than entire set of possible permutations.\nReseting 'nperm' to number of permutations in entire set.")
+        setComplete(control) <- TRUE
+        setNperm(control) <- num.pos
+        setMaxperm(control) <- num.pos
+        message("'nperm' > set of all permutations; Resetting 'nperm'.")
     }
 
     ## if number of possible perms < minperm turn on complete enumeration
     if((num.pos < getMinperm(control))) {
-        control <- update(control, nperm = num.pos, maxperm = num.pos,
-                               complete = TRUE)
-        control$call[["nperm"]] <- eval(control$call[["nperm"]])
-        control$call[["maxperm"]] <- eval(control$call[["maxperm"]])
-        message("Number of permutations possible is less than 'minperm'.\nTurning on complete enumeration via 'complete = TRUE'. See '?how' for details.")
+        setComplete(control) <- TRUE
+        setNperm(control) <- num.pos
+        setMaxperm(control) <- num.pos
+        message("Set of permutations < 'minperm'. Generating entire set.")
     }
 
     ## if complete enumeration, generate all permutations
     if(getComplete(control) && getMake(control)) {
         ap <- allPerms(N, control = control, check = FALSE)
-        control <- update(control, all.perms = ap)
-        control$call[["all.perms"]] <- eval(control$call[["all.perms"]])
+        setAllperms(control) <- ap
     }
     retval <- list(n = num.pos, control = control)
     class(retval) <- "check"



More information about the Vegan-commits mailing list