[Vegan-commits] r2514 - in pkg/permute: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 12 19:41:58 CEST 2013


Author: gsimpson
Date: 2013-06-12 19:41:58 +0200 (Wed, 12 Jun 2013)
New Revision: 2514

Added:
   pkg/permute/R/permute-deprecated.R
   pkg/permute/R/print.check.R
   pkg/permute/R/print.summary.check.R
   pkg/permute/R/summary.check.R
   pkg/permute/man/permCheck-deprecated.Rd
Removed:
   pkg/permute/R/permControl.R
   pkg/permute/R/print.permCheck.R
   pkg/permute/R/print.permControl.R
   pkg/permute/R/print.summary.permCheck.R
   pkg/permute/R/summary.permCheck.R
Modified:
   pkg/permute/man/check.Rd
Log:
clean up sources following deprecation and follow best practice

Deleted: pkg/permute/R/permControl.R
===================================================================
--- pkg/permute/R/permControl.R	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/R/permControl.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,17 +0,0 @@
-`permControl` <- function(within = Within(),
-                          plots = Plots(),
-                          blocks = NULL,
-                          nperm = 199, complete = FALSE,
-                          maxperm = 9999, minperm = 99,
-                          all.perms = NULL,
-                          observed = FALSE)
-{
-    .Deprecated("how", package = "permute")
-    out <- list(within = within, plots = plots, blocks = blocks,
-                nperm = nperm, complete = complete,
-                maxperm = maxperm, minperm = minperm,
-                all.perms = all.perms, observed = observed,
-                blocks.name = deparse(substitute(blocks)))
-    class(out) <- "how"
-    out
-}

Added: pkg/permute/R/permute-deprecated.R
===================================================================
--- pkg/permute/R/permute-deprecated.R	                        (rev 0)
+++ pkg/permute/R/permute-deprecated.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -0,0 +1,43 @@
+`permControl` <- function(within = Within(),
+                          plots = Plots(),
+                          blocks = NULL,
+                          nperm = 199, complete = FALSE,
+                          maxperm = 9999, minperm = 99,
+                          all.perms = NULL,
+                          observed = FALSE)
+{
+    .Deprecated("how", package = "permute")
+    out <- list(within = within, plots = plots, blocks = blocks,
+                nperm = nperm, complete = complete,
+                maxperm = maxperm, minperm = minperm,
+                all.perms = all.perms, observed = observed,
+                blocks.name = deparse(substitute(blocks)))
+    class(out) <- "how"
+    out
+}
+
+`print.permControl` <- function(x, ...)
+{
+    .Deprecated("print.how", package = "permute")
+    class(x) <- "how"
+    print(x)
+}
+
+
+`print.permCheck` <- function(x, ...)
+{
+    print(x$n)
+}
+
+`print.summary.permCheck` <- function(x, ...)
+{
+    cat(paste("Number of possible permutations:", x$n, "\n"))
+    print(x$control)
+    invisible(x)
+}
+
+`summary.permCheck` <- function(object, ...)
+{
+    class(object) <- "summary.permCheck"
+    object
+}

Copied: pkg/permute/R/print.check.R (from rev 2496, pkg/permute/R/print.permCheck.R)
===================================================================
--- pkg/permute/R/print.check.R	                        (rev 0)
+++ pkg/permute/R/print.check.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -0,0 +1,4 @@
+`print.check` <- function(x, ...)
+{
+    print(x$n)
+}

Deleted: pkg/permute/R/print.permCheck.R
===================================================================
--- pkg/permute/R/print.permCheck.R	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/R/print.permCheck.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,4 +0,0 @@
-`print.check` <- function(x, ...)
-{
-    print(x$n)
-}

Deleted: pkg/permute/R/print.permControl.R
===================================================================
--- pkg/permute/R/print.permControl.R	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/R/print.permControl.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,6 +0,0 @@
-`print.permControl` <- function(x, ...)
-{
-    .Deprecated("print.how", package = "permute")
-    class(x) <- "how"
-    print(x)
-}

Copied: pkg/permute/R/print.summary.check.R (from rev 2496, pkg/permute/R/print.summary.permCheck.R)
===================================================================
--- pkg/permute/R/print.summary.check.R	                        (rev 0)
+++ pkg/permute/R/print.summary.check.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -0,0 +1,6 @@
+`print.summary.check` <- function(x, ...)
+{
+    cat(paste("Number of possible permutations:", x$n, "\n"))
+    print(x$control)
+    invisible(x)
+}

Deleted: pkg/permute/R/print.summary.permCheck.R
===================================================================
--- pkg/permute/R/print.summary.permCheck.R	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/R/print.summary.permCheck.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,6 +0,0 @@
-`print.summary.check` <- function(x, ...)
-{
-    cat(paste("Number of possible permutations:", x$n, "\n"))
-    print(x$control)
-    invisible(x)
-}

Copied: pkg/permute/R/summary.check.R (from rev 2496, pkg/permute/R/summary.permCheck.R)
===================================================================
--- pkg/permute/R/summary.check.R	                        (rev 0)
+++ pkg/permute/R/summary.check.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -0,0 +1,5 @@
+`summary.check` <- function(object, ...)
+{
+    class(object) <- "summary.check"
+    object
+}

Deleted: pkg/permute/R/summary.permCheck.R
===================================================================
--- pkg/permute/R/summary.permCheck.R	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/R/summary.permCheck.R	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,5 +0,0 @@
-`summary.check` <- function(object, ...)
-{
-    class(object) <- "summary.check"
-    object
-}

Modified: pkg/permute/man/check.Rd
===================================================================
--- pkg/permute/man/check.Rd	2013-06-12 15:50:07 UTC (rev 2513)
+++ pkg/permute/man/check.Rd	2013-06-12 17:41:58 UTC (rev 2514)
@@ -1,7 +1,5 @@
 \name{check}
 \alias{check}
-\alias{permCheck} % for the deprecated function
-\alias{permCheck-deprecated} % for the deprecated function
 \alias{print.check}
 \alias{print.summary.check}
 \alias{summary.check}
@@ -28,12 +26,11 @@
   \item{object}{an R object. See Details for a
     complete description, especially for \code{numPerms}. For
     \code{\link{summary.check}} an object of class
-    \code{"check"}. For \code{\link{summary.allPerms}} an object of
-    class \code{"allPerms"}.} 
+    \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
+  \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{n}{the number of observations or an 'object' from which the
@@ -93,16 +90,11 @@
 }
 \value{
   For \code{check} a list containing the maximum number of
-  permutations possible and an object of class
-  \code{"\link{how}"}.
-
-  For \code{permuplot}, a plot on the currently active device.
+  permutations possible and an object of class \code{"\link{how}"}.
 }
 \author{Gavin L. Simpson}
-\seealso{\code{\link{shuffle}} and \code{\link{how}}.}
+\seealso{\code{\link{shuffle}} and \code{\link{how}}.}\examples{
 
-\examples{
-
 ## use example data from ?pyrifos in package vegan
 require(vegan)
 example(pyrifos)
@@ -137,7 +129,6 @@
       control = how(plots = Plots(strata = ditch),
                     within = Within(type = "series", mirror = TRUE)))
 
-\dontrun{ % FIXME these fail in allStrata needing 235.5 Gb RAM!!
 ## time series within strata, no mirroring, same permutation
 ## within strata
 check(pyrifos,
@@ -151,6 +142,7 @@
                     within = Within(type = "series", mirror = TRUE,
                                     constant = TRUE)))
 
+\dontrun{ % FIXME these fail in allStrata needing 235.5 Gb RAM!!
 ## permute strata
 check(pyrifos, how(plots = Plots(strata = ditch, type = "free"),
                    within = Within(type = "none")))
@@ -195,7 +187,8 @@
 %% Fixed one, above, but there may still be problems with some of
 %% the code below:
 \dontrun{
-allPerms(7, how(type = "free", strata = fac))
+allPerms(7, how(within = Within(type = "free"),
+                plots = Plots(strata = fac)))
 ## series permutations in levels of strata
 numPerms(7, how(type = "series", strata = fac))
 allPerms(7, how(type = "series", strata = fac))

Added: pkg/permute/man/permCheck-deprecated.Rd
===================================================================
--- pkg/permute/man/permCheck-deprecated.Rd	                        (rev 0)
+++ pkg/permute/man/permCheck-deprecated.Rd	2013-06-12 17:41:58 UTC (rev 2514)
@@ -0,0 +1,69 @@
+\name{permCheck-deprecated}
+\alias{permCheck} % for the deprecated function
+\alias{permCheck-deprecated} % for the deprecated function
+\alias{print.permCheck}
+\alias{print.summary.permCheck}
+\alias{summary.permCheck}
+
+\title{Utility functions for permutation schemes}
+\description{
+  \code{permCheck} provides checking of permutation schemes for
+  validity. \code{permuplot} produces a graphical representation of the
+  selected permutation design.
+}
+\usage{
+permCheck(object, control = how(), make.all = TRUE)
+
+\method{summary}{permCheck}(object, \dots)
+}
+
+\arguments{
+  \item{object}{an R object. See Details for a
+    complete description, especially for \code{numPerms}. For
+    \code{\link{summary.permCheck}} an object of class
+    \code{"permCheck"}.} 
+  \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
+    moment.}
+}
+\details{
+  \code{permCheck} is a utility functions for working
+  with the new permutation schemes available in \code{\link{shuffle}}.
+
+  \code{permCheck} is used to check the current permutation schemes
+  against the object to which it will be applied. It calculates the
+  maximum number of possible permutations for the number of observations
+  in \code{object} and the permutation scheme described by
+  \code{control}. The returned object contains component \code{control},
+  an object of class \code{"how"} suitably modified if
+  \code{permCheck} identifies a problem.
+
+  The main problem is requesting more permutations than possible with
+  the number of observations and the permutation design. In such cases,
+  \code{nperm} is reduced to equal the number of possible permutations,
+  and complete enumeration of all permutations is turned on
+  (\code{control$complete} is set to \code{TRUE}). 
+
+  Alternatively, if the number of possible permutations is low, and less
+  than \code{control$minperm}, it is better to enumerate all possible
+  permutations, and as such complete enumeration of all permutations is
+  turned  on (\code{control$complete} is set to \code{TRUE}).
+}
+\value{
+  For \code{permCheck} a list containing the maximum number of
+  permutations possible and an object of class
+  \code{"\link{how}"}.
+
+  For \code{permuplot}, a plot on the currently active device.
+}
+\author{Gavin L. Simpson}
+\seealso{\code{\link{shuffle}} and \code{\link{how}}.}
+\keyword{ utilities }
+\keyword{ methods }



More information about the Vegan-commits mailing list