[Vegan-commits] r2676 - pkg/permute/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 8 04:10:12 CET 2013


Author: gsimpson
Date: 2013-11-08 04:10:12 +0100 (Fri, 08 Nov 2013)
New Revision: 2676

Modified:
   pkg/permute/man/allPerms.Rd
   pkg/permute/man/get-methods.Rd
   pkg/permute/man/how.Rd
   pkg/permute/man/numPerms.Rd
   pkg/permute/man/shuffle.Rd
Log:
minor documentation updates, tweaks, edit, corrections

Modified: pkg/permute/man/allPerms.Rd
===================================================================
--- pkg/permute/man/allPerms.Rd	2013-11-08 03:06:24 UTC (rev 2675)
+++ pkg/permute/man/allPerms.Rd	2013-11-08 03:10:12 UTC (rev 2676)
@@ -75,9 +75,8 @@
 ## design
 fac <- gl(2,6)
 ctrl <- how(within = Within(type = "grid", mirror = FALSE,
-                                    constant = TRUE,
-                                    nrow = 3, ncol = 2),
-                    plots = Plots(strata = fac))
+                            constant = TRUE, nrow = 3, ncol = 2),
+            plots = Plots(strata = fac))
 Nobs <- length(fac)
 numPerms(seq_len(Nobs), control = ctrl) ## 6
 (tmp <- allPerms(Nobs, control = ctrl, observed = TRUE))

Modified: pkg/permute/man/get-methods.Rd
===================================================================
--- pkg/permute/man/get-methods.Rd	2013-11-08 03:06:24 UTC (rev 2675)
+++ pkg/permute/man/get-methods.Rd	2013-11-08 03:10:12 UTC (rev 2676)
@@ -91,7 +91,7 @@
 \method{getBlocks}{how}(object, ...)
 
 \method{getStrata}{how}(object, which = c("plots", "blocks"),
-         drop = TRUE, ...)
+          drop = TRUE, ...)
 
 \method{getType}{how}(object, which = c("plots", "within"), ...)
 
@@ -123,10 +123,14 @@
   \item{\dots}{Arguments passed on to other methods.}
 }
 \details{
-  TODO
+  These are extractor functions for working with permutation design
+  objects created by \code{\link{how}}. They should be used in
+  preference to directly subsetting the permutation design in case the
+  internal structure of object changes as \pkg{permute} is developed.
 }
 \value{
-  TODO
+  These are simple extractor functions and return the contents of the
+  corresponding components of \code{object}.
 }
 \author{Gavin Simpson}
 \seealso{\code{\link{check}}, a utility function for checking
@@ -134,8 +138,10 @@
 }
 
 \examples{
-set.seed(1234)
-
+## extract components from a "how" object
+hh <- how()
+getWithin(hh)
+getNperm(hh)
 }
 \keyword{ methods }
 \keyword{ utils }
\ No newline at end of file

Modified: pkg/permute/man/how.Rd
===================================================================
--- pkg/permute/man/how.Rd	2013-11-08 03:06:24 UTC (rev 2675)
+++ pkg/permute/man/how.Rd	2013-11-08 03:10:12 UTC (rev 2676)
@@ -34,16 +34,17 @@
     \code{plots} each require a named list as produced by \code{Within}
     and \code{Plots} respectively. \code{blocks} takes a factor, the
     levels of which define the blocking structure.}
-  \item{nperm}{the number of permutations.}
+  \item{nperm}{numeric; the number of permutations.}
   \item{complete}{logical; should complete enumeration of all
     permutations be performed?}
-  \item{type}{the type of permutations required. One of \code{"free"},
-    \code{"series"}, \code{"grid"} or \code{"none"}. See Details.}
-  \item{maxperm}{the maximum number of permutations to
-    perform. Currently unused.}
-  \item{minperm}{the lower limit to the number of possible permutations
-    at which complete enumeration is performed. See argument
-    \code{complete} and Details, below.}
+  \item{type}{character; the type of permutations required. One of
+    \code{"free"}, \code{"series"}, \code{"grid"} or \code{"none"}. See
+    Details.} 
+  \item{maxperm}{numeric; the maximum number of permutations to
+    perform. Currently unused.} 
+  \item{minperm}{numeric; the lower limit to the number of possible
+    permutations at which complete enumeration is performed. See argument
+    \code{complete} and Details, below.} 
   \item{all.perms}{an object of class \code{allPerms}, the result of a
     call to \code{\link{allPerms}}.}
   \item{observed}{logical; should the observed permutation be returned
@@ -69,8 +70,7 @@
   experimental design, mirrored permutations can be considered
   part of the Null model, and as such increase the number of possible
   permutations. The default is to not use mirroring so you must
-  explicitly turn this on using \code{mirror = TRUE} in
-  \code{how}.
+  explicitly turn this on using \code{mirror = TRUE} in \code{how}.
 
   To permute plots rather than the observations within plots (the
   levels of \code{strata}), use \code{Within(type = "none")} and
@@ -98,12 +98,15 @@
     3.1}. Wageningen: Agricultural Mathematics Group. (UR).
 }
 \author{Gavin Simpson}
-\seealso{\code{\link{shuffle}} for permuting from a design,
-  \code{\link{check}}, a utility function for checking permutation
-  design described by \code{how}.}
+\seealso{\code{\link{shuffle}} and \code{\link{shuffleSet}} for
+  permuting from a design, and \code{\link{check}}, a utility function
+  for checking permutation design described by \code{how}.}
 \examples{
-plts <- gl(4,10)
-blks <- gl(2,20)
+## Set up factors for the Plots and Blocks
+plts <- gl(4, 10) ## 4 Plots of 10 samples each
+blks <- gl(2, 20) ## 2 Blocks of 20 samples each
+
+## permutation design
 h1 <- how(within = Within(type = "series", mirror = TRUE),
           plots = Plots(strata = plts, type = "series"),
           blocks = blks)
@@ -111,6 +114,7 @@
 ## The design can be updated...
 ## ... remove the blocking:
 update(h1, blocks = NULL)
+
 ## ... or switch the type of shuffling at a level:
 update(h1, plots = update(getPlots(h1), type = "none"))
 }

Modified: pkg/permute/man/numPerms.Rd
===================================================================
--- pkg/permute/man/numPerms.Rd	2013-11-08 03:06:24 UTC (rev 2675)
+++ pkg/permute/man/numPerms.Rd	2013-11-08 03:10:12 UTC (rev 2676)
@@ -27,7 +27,7 @@
   not just the object containing the observations. 
 }
 \value{
-  The (numeric) number of possible permutaytions of observations in
+  The (numeric) number of possible permutations of observations in
   \code{object}.
 }
 \note{
@@ -67,12 +67,12 @@
 ## permutation design --- see ?how
 ctrl <- how() ## defaults to freely exchangeable
 
-## vector
+## vector input
 v <- 1:10
 (obs <- nobs(v))
 numPerms(v, control = ctrl)
 
-## integer
+## integer input
 len <- length(v)
 (obs <- nobs(len))
 numPerms(len, control = ctrl)
@@ -85,7 +85,7 @@
 ctrl <- how(within = Within(type = "series", mirror = TRUE))
 numPerms(v, control = ctrl)
 
-## Try blocking - 2 groups of 5
+## Try blocking --- 2 groups of 5
 bl <- numPerms(v, control = how(blocks = gl(2,5)))
 bl
 

Modified: pkg/permute/man/shuffle.Rd
===================================================================
--- pkg/permute/man/shuffle.Rd	2013-11-08 03:06:24 UTC (rev 2675)
+++ pkg/permute/man/shuffle.Rd	2013-11-08 03:10:12 UTC (rev 2676)
@@ -37,8 +37,8 @@
   permutation of the observations 1, \ldots, n using the permutation
   scheme described by argument \code{control}.
   
-  For \code{how} a list with components for each of the possible
-  arguments.
+  For \code{permute} the \code{i}th permutation from the set of all
+  permutations, or a random permutation from the design.
 }
 %\note{
 %  \code{shuffle} is currently used in one Vegan function;



More information about the Vegan-commits mailing list