[Vegan-commits] r2684 - in pkg/permute: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Nov 9 03:00:20 CET 2013
Author: gsimpson
Date: 2013-11-09 03:00:19 +0100 (Sat, 09 Nov 2013)
New Revision: 2684
Modified:
pkg/permute/R/check.R
pkg/permute/R/permCheck.R
pkg/permute/inst/ChangeLog
pkg/permute/man/check.Rd
pkg/permute/man/permCheck-deprecated.Rd
Log:
remove make.all and observed arguments
Modified: pkg/permute/R/check.R
===================================================================
--- pkg/permute/R/check.R 2013-11-09 01:57:05 UTC (rev 2683)
+++ pkg/permute/R/check.R 2013-11-09 02:00:19 UTC (rev 2684)
@@ -1,5 +1,4 @@
-`check` <- function(object, control = how(), make.all = TRUE,
- observed = FALSE)
+`check` <- function(object, control = how())
{
## if object is numeric or integer and of length 1,
## extend the object
@@ -68,21 +67,25 @@
## check if number requested permutations exceeds max possible
if(getNperm(control) > num.pos) {
- control$nperm <- control$maxperm <- num.pos
- control$complete <- TRUE
+ 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"]])
}
-
+
## if number of possible perms < minperm turn on complete enumeration
- if(num.pos < getMinperm(control)) {
- control$nperm <- control$maxperm <- num.pos
- control$complete <- TRUE
+ 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"]])
}
## if complete enumeration, generate all permutations
- if(getComplete(control)$complete && make.all) {
- control$all.perms <- allPerms(N, control = control,
- max = getMaxperm(control),
- observed = observed)
+ if(getComplete(control) && getMake(control)) {
+ ap <- allPerms(N, control = control)
+ control <- update(control, all.perms = ap)
+ control$call[["all.perms"]] <- eval(control$call[["all.perms"]])
}
retval <- list(n = num.pos, control = control)
class(retval) <- "check"
Modified: pkg/permute/R/permCheck.R
===================================================================
--- pkg/permute/R/permCheck.R 2013-11-09 01:57:05 UTC (rev 2683)
+++ pkg/permute/R/permCheck.R 2013-11-09 02:00:19 UTC (rev 2684)
@@ -1,6 +1,5 @@
## deprecate check
-`permCheck` <- function(object, control = how(),
- make.all = TRUE) {
+`permCheck` <- function(object, control = how()) {
.Deprecated(new = "check", "permute")
- check(object = object, control = control, make.all = make.all)
+ check(object = object, control = control)
}
Modified: pkg/permute/inst/ChangeLog
===================================================================
--- pkg/permute/inst/ChangeLog 2013-11-09 01:57:05 UTC (rev 2683)
+++ pkg/permute/inst/ChangeLog 2013-11-09 02:00:19 UTC (rev 2684)
@@ -50,6 +50,11 @@
the `"how"` object. Use `getMinperm()` to extract the component
no-longer returned by `getComplete()`.
+ * check: function looses arguments `make.all` and `observed` as
+ these are in the control object returned by `how()`.
+
+ The logic of some of the checks has been tweaked slightly.
+
* Documentation fixes in examples of `allPerms` and `check`.
* permuplot: This is horribly broken and I'm not sure if it will
Modified: pkg/permute/man/check.Rd
===================================================================
--- pkg/permute/man/check.Rd 2013-11-09 01:57:05 UTC (rev 2683)
+++ pkg/permute/man/check.Rd 2013-11-09 02:00:19 UTC (rev 2684)
@@ -11,7 +11,7 @@
selected permutation design.
}
\usage{
-check(object, control = how(), make.all = TRUE, observed = FALSE)
+check(object, control = how())
\method{summary}{check}(object, \dots)
}
@@ -22,11 +22,6 @@
\code{\link{summary.check}} an object of class \code{"check"}.}
\item{control}{a list of control values describing properties of the
permutation design, as returned by a call to \code{\link{how}}.}
- \item{make.all}{logical; should \code{check} generate all
- possible permutations? Useful if want to check permutation design
- but not produce the matrix of all permutations.}
- \item{observed}{logical; if making all possible permutations, should
- the set include the observed permutation too?}
\item{\dots}{arguments to other methods.}
}
\details{
@@ -127,13 +122,13 @@
check(1:12, ctrl)
numPerms(1:12, control = ctrl)
-(tmp <- allPerms(12, control = ctrl, observed = TRUE))
+(tmp <- allPerms(12, control = update(ctrl, observed = TRUE)))
(tmp2 <- allPerms(12, control = ctrl))
## turn on mirroring
ctrl <- update(ctrl, within = update(getWithin(ctrl), mirror = TRUE))
numPerms(1:12, control = ctrl)
-(tmp3 <- allPerms(12, control = ctrl, observed = TRUE))
+(tmp3 <- allPerms(12, control = update(ctrl, observed = TRUE)))
(tmp4 <- allPerms(12, control = ctrl))
## prints out details of the permutation scheme as
## well as the matrix of permutations
Modified: pkg/permute/man/permCheck-deprecated.Rd
===================================================================
--- pkg/permute/man/permCheck-deprecated.Rd 2013-11-09 01:57:05 UTC (rev 2683)
+++ pkg/permute/man/permCheck-deprecated.Rd 2013-11-09 02:00:19 UTC (rev 2684)
@@ -12,7 +12,7 @@
selected permutation design.
}
\usage{
-permCheck(object, control = how(), make.all = TRUE)
+permCheck(object, control = how())
\method{summary}{permCheck}(object, \dots)
}
@@ -25,9 +25,6 @@
\item{control}{a list of control values describing properties of the
permutation design, as returned by a call to
\code{\link{how}}.}
- \item{make.all}{logical; should \code{permCheck} generate all
- possible permutations? Useful if want to check permutation design
- but not produce the matrix of all permutations.}
\item{\dots}{arguments to other methods. For \code{permuplot}
graphical parameters can be passed to plotting functions, though
note that not all parameters will be accepted gracefully at the
More information about the Vegan-commits
mailing list