[Vegan-commits] r2701 - in pkg/permute: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Nov 12 21:22:29 CET 2013
Author: gsimpson
Date: 2013-11-12 21:22:28 +0100 (Tue, 12 Nov 2013)
New Revision: 2701
Modified:
pkg/permute/R/allPerms.R
pkg/permute/inst/ChangeLog
pkg/permute/man/allPerms.Rd
Log:
add argument 'check'; turn on some messages
Modified: pkg/permute/R/allPerms.R
===================================================================
--- pkg/permute/R/allPerms.R 2013-11-12 20:17:26 UTC (rev 2700)
+++ pkg/permute/R/allPerms.R 2013-11-12 20:22:28 UTC (rev 2701)
@@ -1,4 +1,4 @@
-`allPerms` <- function(n, control = how()) {
+`allPerms` <- function(n, control = how(), check = TRUE) {
## start
v <- n
## expand n if a numeric or integer vector of length 1
@@ -8,7 +8,8 @@
n <- nobs(v)
## check permutation scheme and update control
make <- getMake(control)
- pcheck <- check(v, control = update(control, make = FALSE))
+ if (check)
+ pcheck <- check(v, control = update(control, make = FALSE))
## ctrl <- pcheck$control
## if we do copy the new updated control, we need to update to
## reset make
Modified: pkg/permute/inst/ChangeLog
===================================================================
--- pkg/permute/inst/ChangeLog 2013-11-12 20:17:26 UTC (rev 2700)
+++ pkg/permute/inst/ChangeLog 2013-11-12 20:22:28 UTC (rev 2701)
@@ -17,6 +17,18 @@
`shuffleSet()`. The `check` argument is retained though, as a way for
function writers to skip that part of the permute workflow if desired.
+ * allPerms: gains an argument `check`, which defaults to `TRUE`. This
+ is used to turn off checking within `allPerms` if desired. A use-case
+ for this is in `check()`, which might end up caling `allPerms()` to
+ generate the set of all permutations. In that case `allPerms()` used
+ to recheck the design. Now this doesn't happen.
+
+ Turned on some `message()`s when the user asks for too many permutations
+ (more than the set of possible permutations) and when the set of
+ possible permutations is smaller than the `minperm` value stored in the
+ `"how"` object. The latter notifies the user that the entire set of
+ permutations is being generated.
+
Version 0.7-6
* summary.allPerms: Was printing two slightly different subtitles.
Modified: pkg/permute/man/allPerms.Rd
===================================================================
--- pkg/permute/man/allPerms.Rd 2013-11-12 20:17:26 UTC (rev 2700)
+++ pkg/permute/man/allPerms.Rd 2013-11-12 20:22:28 UTC (rev 2701)
@@ -10,7 +10,7 @@
permutations for a given R object and a specified permutation design.
}
\usage{
-allPerms(n, control = how())
+allPerms(n, control = how(), check = TRUE)
\method{summary}{allPerms}(object, \dots)
}
@@ -20,6 +20,9 @@
\item{control}{a list of control values describing properties of the
permutation design, as returned by a call to
\code{\link{how}}.}
+ \item{check}{logical; should \code{allPerms} check the design? The
+ default is to check, but this can be skipped, for example if a
+ function checked the design earlier.}
\item{object}{an object of class \code{"allPerms"}.}
\item{\dots}{arguments to other methods.}
}
More information about the Vegan-commits
mailing list