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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 9 01:32:37 CET 2013


Author: gsimpson
Date: 2013-11-09 01:32:36 +0100 (Sat, 09 Nov 2013)
New Revision: 2680

Modified:
   pkg/permute/NAMESPACE
   pkg/permute/R/getFoo-methods.R
   pkg/permute/inst/ChangeLog
Log:
adds new methods for extracting make and observed components

Modified: pkg/permute/NAMESPACE
===================================================================
--- pkg/permute/NAMESPACE	2013-11-08 13:22:06 UTC (rev 2679)
+++ pkg/permute/NAMESPACE	2013-11-09 00:32:36 UTC (rev 2680)
@@ -4,8 +4,8 @@
        `shuffleFree`, `shuffleSeries`, `shuffleGrid`, `shuffleStrata`,
        `getBlocks`, `getWithin`, `getStrata`, `getType`, `getMirror`,
        `getConstant`, `getPlots`, `getRow`, `getCol`, `getDim`,
-       `getNperm`,`getMaxperm`, `getMinperm`, `getComplete`, `shuffleSet`,
-       `how`)
+       `getNperm`,`getMaxperm`, `getMinperm`, `getComplete`, `getMake`,
+       `getObserved`, `shuffleSet`, `how`)
 
 ### Imports: nobs() only exists in R 2.13.0 for import. We define the
 ### same nobs() generic in permute for export in older R.
@@ -74,3 +74,7 @@
 S3method(`getDim`, `default`)
 S3method(`getDim`, `how`)
 S3method(`getDim`, `permControl`)
+S3method(`getMake`, `default`)
+S3method(`getMake`, `how`)
+S3method(`getObserved`, `default`)
+S3method(`getObserved`, `how`)

Modified: pkg/permute/R/getFoo-methods.R
===================================================================
--- pkg/permute/R/getFoo-methods.R	2013-11-08 13:22:06 UTC (rev 2679)
+++ pkg/permute/R/getFoo-methods.R	2013-11-09 00:32:36 UTC (rev 2680)
@@ -343,11 +343,36 @@
 }
 
 `getComplete.permControl` <- function(object, ...) {
-    list(complete = object$complete,
-         minperm = object$minperm)
+    object$complete
 }
 
 `getComplete.how` <- function(object, ...) {
-    list(complete = object$complete,
-         minperm = object$minperm)
+    object$complete
 }
+
+## Returns whether all permutation should/should not be made
+`getMake` <- function(object, ...) {
+    UseMethod("getMake")
+}
+
+`getMake.default` <- function(object, ...) {
+    stop("No default method for `getMake`")
+}
+
+`getMake.how` <- function(object, ...) {
+    object$make
+}
+
+## Returns whether the observed permutation should be in
+## the set of permutations
+`getObserved` <- function(object, ...) {
+    UseMethod("getObserved")
+}
+
+`getObserved.default` <- function(object, ...) {
+    stop("No default method for `getObserved`")
+}
+
+`getObserved.how` <- function(object, ...) {
+    object$observed
+}

Modified: pkg/permute/inst/ChangeLog
===================================================================
--- pkg/permute/inst/ChangeLog	2013-11-08 13:22:06 UTC (rev 2679)
+++ pkg/permute/inst/ChangeLog	2013-11-09 00:32:36 UTC (rev 2680)
@@ -39,6 +39,14 @@
 	`summary.allPerms` (its `print` method, more correctly) now prints
 	the permutation design alongside the set of permutations.
 
+	* get-methods: new extractor functions `getObserved()` and
+	`getMake()` return the `observed` and `make` components of object
+	created by `how()`.
+
+	* getComplete: This now only returns the `complete` component of
+	the `"how"` object. Use `getMinperm()` to extract the component
+	no-longer returned by `getComplete()`.
+
 	* Documentation fixes in examples of `allPerms` and `check`.
 
 	* permuplot: This is horribly broken and I'm not sure if it will



More information about the Vegan-commits mailing list