[Vegan-commits] r1662 - pkg/permute/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 29 09:26:25 CEST 2011


Author: gsimpson
Date: 2011-06-29 09:26:23 +0200 (Wed, 29 Jun 2011)
New Revision: 1662

Added:
   pkg/permute/R/getFoo-methods.R
Modified:
   pkg/permute/R/allPerms.R
Log:
move getFoo methods for Within, Blocks, Strata to their own file


Modified: pkg/permute/R/allPerms.R
===================================================================
--- pkg/permute/R/allPerms.R	2011-06-28 22:55:41 UTC (rev 1661)
+++ pkg/permute/R/allPerms.R	2011-06-29 07:26:23 UTC (rev 1662)
@@ -173,47 +173,6 @@
     return(res)
 }
 
-## Extractor functions for blocks and within
-getBlocks <- function(object, ...) {
-    UseMethod("getBlocks")
-}
-
-getBlocks.default <- function(object, ...) {
-    stop("No default method for 'getBlocks()'")
-}
-
-getBlocks.permControl <- function(object, ...) {
-    object$blocks
-}
-
-getWithin <- function(object, ...) {
-    UseMethod("getWithin")
-}
-
-getWithin.default <- function(object, ...) {
-    stop("No default method for 'getWithin()'")
-}
-
-getWithin.permControl <- function(object, ...) {
-    object$within
-}
-
-getStrata <- function(object, ...) {
-    UseMethod("getStrata")
-}
-
-getStrata.default <- function(object, ...) {
-    stop("No default method for 'getStrata()'")
-}
-
-getStrata.permControl <- function(object, ...) {
-    object$strata
-}
-
-## suppose we can also have setBlocks() etc...
-## to update the control object in place....
-
-
 ## enumerate all possible permutations for a more complicated
 ## design
 ## fac <- gl(2,6)

Added: pkg/permute/R/getFoo-methods.R
===================================================================
--- pkg/permute/R/getFoo-methods.R	                        (rev 0)
+++ pkg/permute/R/getFoo-methods.R	2011-06-29 07:26:23 UTC (rev 1662)
@@ -0,0 +1,39 @@
+## Extractor functions for blocks and within
+getBlocks <- function(object, ...) {
+    UseMethod("getBlocks")
+}
+
+getBlocks.default <- function(object, ...) {
+    stop("No default method for 'getBlocks()'")
+}
+
+getBlocks.permControl <- function(object, ...) {
+    object$blocks
+}
+
+getWithin <- function(object, ...) {
+    UseMethod("getWithin")
+}
+
+getWithin.default <- function(object, ...) {
+    stop("No default method for 'getWithin()'")
+}
+
+getWithin.permControl <- function(object, ...) {
+    object$within
+}
+
+getStrata <- function(object, ...) {
+    UseMethod("getStrata")
+}
+
+getStrata.default <- function(object, ...) {
+    stop("No default method for 'getStrata()'")
+}
+
+getStrata.permControl <- function(object, ...) {
+    object$strata
+}
+
+## suppose we can also have setBlocks() etc...
+## to update the control object in place....



More information about the Vegan-commits mailing list