[Vegan-commits] r2644 - in pkg/permute: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 4 23:48:22 CET 2013


Author: gsimpson
Date: 2013-11-04 23:48:21 +0100 (Mon, 04 Nov 2013)
New Revision: 2644

Modified:
   pkg/permute/DESCRIPTION
   pkg/permute/R/how.R
   pkg/permute/inst/ChangeLog
   pkg/permute/inst/TODO.md
   pkg/permute/man/how.Rd
Log:
adds matched call to object returned by 'how' which allows the use of 'update' to update the permutation design. Added an example to the help page. Bump to 0.7-5.

Modified: pkg/permute/DESCRIPTION
===================================================================
--- pkg/permute/DESCRIPTION	2013-11-04 22:46:58 UTC (rev 2643)
+++ pkg/permute/DESCRIPTION	2013-11-04 22:48:21 UTC (rev 2644)
@@ -1,6 +1,6 @@
 Package: permute
 Title: Functions for generating restricted permutations of data
-Version: 0.7-4
+Version: 0.7-5
 Date: $Date$
 Author: Gavin L. Simpson
 Maintainer: Gavin L. Simpson <gavin.simpson at uregina.ca>

Modified: pkg/permute/R/how.R
===================================================================
--- pkg/permute/R/how.R	2013-11-04 22:46:58 UTC (rev 2643)
+++ pkg/permute/R/how.R	2013-11-04 22:48:21 UTC (rev 2644)
@@ -12,7 +12,8 @@
                 nperm = nperm, complete = complete,
                 maxperm = maxperm, minperm = minperm,
                 all.perms = all.perms, observed = observed,
-                blocks.name = deparse(substitute(blocks)))
+                blocks.name = deparse(substitute(blocks)),
+                call = match.call())
     class(out) <- "how"
     out
 }

Modified: pkg/permute/inst/ChangeLog
===================================================================
--- pkg/permute/inst/ChangeLog	2013-11-04 22:46:58 UTC (rev 2643)
+++ pkg/permute/inst/ChangeLog	2013-11-04 22:48:21 UTC (rev 2644)
@@ -2,6 +2,11 @@
 
 permute ChangeLog
 
+Version 0.7-5
+
+	* how: the matched call is now returned permitting the use of
+	`update()` to update elements of a stored permutation design object.
+
 Version 0.7-4
 
 	* Deprecated functions: Completed the deprecation of `permCheck()`

Modified: pkg/permute/inst/TODO.md
===================================================================
--- pkg/permute/inst/TODO.md	2013-11-04 22:46:58 UTC (rev 2643)
+++ pkg/permute/inst/TODO.md	2013-11-04 22:48:21 UTC (rev 2644)
@@ -11,12 +11,33 @@
    object already exists and want to tweak it. Example is in `?allPerms`
    where I turn mirroring on via
 
-       ctrl$within$mirror <- TRUE
+        ctrl$within$mirror <- TRUE
 
-   But how? Best idea currently is an `update.permControl` method. The
-   generic is in namespace `stats`. Or a `modify()` function, perhaps
-   coupled with specific replacement functions for certain components.
+    But how? Best idea currently is an `update.permControl` method. The
+    generic is in namespace `stats`. Or a `modify()` function, perhaps
+    coupled with specific replacement functions for certain components.
+   
+    *DONE, in part, in 0.7-5* The matched call is now returned by `how()`
+    and this allows `update()` to do its work with no further effort from
+    me. What isn't so neat is that currently this means you need to type
+    out in full any specification of `within` and `plots` as these take
+    the results of function calls. Hence we have, from `./man/how.Rd`
+    
+        plts <- gl(4,10)
+        blks <- gl(2,20)
+        h1 <- how(within = Within(type = "series", mirror = TRUE),
+                  plots = Plots(strata = plts, type = "series"),
+                  blocks = blks)
 
+        ## The design can be updated...
+        ## ... remove the blocking:
+        update(h1, blocks = NULL)
+        ## ... or switch the type of shuffling at a level:
+        update(h1, plots = Plots(strata = plts, type = "none"))
+        
+    Where in the second `update()` the entire `Plots()` call needs to
+    repeated to change just one part, the `type`.
+         
  * `permControl` - deprecate this in favour of `how` as in "how to
    permute"? *DONE Completed in 0.7-4*
 
@@ -26,4 +47,4 @@
    easy without a lot of work to visualise all possible schemes.
 
  * `check` insists on returning all permutations *without* the observed
-   on.
\ No newline at end of file
+   one.

Modified: pkg/permute/man/how.Rd
===================================================================
--- pkg/permute/man/how.Rd	2013-11-04 22:46:58 UTC (rev 2643)
+++ pkg/permute/man/how.Rd	2013-11-04 22:48:21 UTC (rev 2644)
@@ -104,8 +104,14 @@
 \examples{
 plts <- gl(4,10)
 blks <- gl(2,20)
-how(within = Within(type = "series", mirror = TRUE),
-    plots = Plots(strata = plts, type = "series"),
-    blocks = blks)
+h1 <- how(within = Within(type = "series", mirror = TRUE),
+          plots = Plots(strata = plts, type = "series"),
+          blocks = blks)
+
+## The design can be updated...
+## ... remove the blocking:
+update(h1, blocks = NULL)
+## ... or switch the type of shuffling at a level:
+update(h1, plots = Plots(strata = plts, type = "none"))
 }
 \keyword{ utils  }
\ No newline at end of file



More information about the Vegan-commits mailing list