[Vegan-commits] r2738 - in pkg/vegan: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 21 19:26:38 CET 2013


Author: jarioksa
Date: 2013-11-21 19:26:38 +0100 (Thu, 21 Nov 2013)
New Revision: 2738

Modified:
   pkg/vegan/R/anovacca.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/anovacca.Rd
Log:
update anovacca interface and add by = 'margin'

Modified: pkg/vegan/R/anovacca.R
===================================================================
--- pkg/vegan/R/anovacca.R	2013-11-21 18:04:39 UTC (rev 2737)
+++ pkg/vegan/R/anovacca.R	2013-11-21 18:26:38 UTC (rev 2738)
@@ -1,7 +1,9 @@
 `anovacca` <-
     function(object, ..., permutations = how(nperm=999), by = NULL,
-             strata = NULL) 
+             model = c("reduced", "direct", "full"),
+             parallel = getOption("mc.cores"), strata = NULL) 
 {
+    model <- match.arg(model)
     if (!exists(".Random.seed", envir = .GlobalEnv,
                 inherits = FALSE)) 
         runif(1)
@@ -32,15 +34,7 @@
     dotargs <- list(...)
     ## we do not want to give dotargs to anova.ccalist, but we
     ## evaluate 'parallel' and 'model' here
-    if (is.null(dotargs$model))
-        model <- "reduced"
-    else
-        model <- dotargs$model
-    if (is.null(dotargs$parallel))
-        parallel <- NULL
-    else
-        parallel <- dotargs$parallel
-    if (length(dotargs)) {
+     if (length(dotargs)) {
         isCCA <- sapply(dotargs, function(z) inherits(z, "cca"))
         if (any(isCCA)) {
             dotargs <- dotargs[isCCA]
@@ -55,13 +49,16 @@
     }
     ## by cases
     if (!is.null(by)) {
-        by <- match.arg(by, c("terms", "margin"))
+        by <- match.arg(by, c("terms", "margin", "axis"))
         sol <- switch(by,
                       "terms" = anovacca.byterm(object,
                       permutations = permutations,
                       model = model, parallel = parallel),
                       "margin" = anovacca.bymargin(object,
                       permutations = permutations,
+                      model = model, parallel = parallel),
+                      "axis" = anovacca.byaxis(object,
+                      permutations = permutations,
                       model = model, parallel = parallel))
         return(sol)
     }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-11-21 18:04:39 UTC (rev 2737)
+++ pkg/vegan/inst/ChangeLog	2013-11-21 18:26:38 UTC (rev 2738)
@@ -18,8 +18,15 @@
 	models in anova.ccalist. Case by = "margin" directly calls
 	permutest.cca and gets the significances from differences of
 	residual variation similarly as anova.ccalist. Case by = "axis" is
-	not yet implemented.
+	is implemented as a marginal model.
 
+	Simple permutations give identical results for "term" and "axis"
+	cases, but by = "margin" is different. Marginal models were
+	implemented as partial models with other parameters partialled out
+	in vegan 2.0 and earlier, but the current implementation is an
+	anova.ccalist model where the parameter in question was removed
+	and model compared against the complete model.
+
 	* commsim: documentation (commsim.Rd) was restructured so that
 	nullmodels were collected under separate sections with a brief
 	introductory text and shorter specific text of the

Modified: pkg/vegan/man/anovacca.Rd
===================================================================
--- pkg/vegan/man/anovacca.Rd	2013-11-21 18:04:39 UTC (rev 2737)
+++ pkg/vegan/man/anovacca.Rd	2013-11-21 18:26:38 UTC (rev 2738)
@@ -23,7 +23,8 @@
 
 \usage{
 anovacca(object, ..., permutations = how(nperm=999),
-      by = NULL, strata = NULL)
+      by = NULL, model = c("reduced", "direct", "full"), 
+      parallel = getOption("mc.cores"), strata = NULL)
 }
 
 \arguments{
@@ -46,6 +47,10 @@
     the terms (each marginal term analysed in a model with all other
     variables). Not yet implemented.}
 
+  \item{model}{Model}
+
+  \item{parallel}{Parallel processing}
+
   \item{strata}{An integer vector or factor specifying the strata for
     permutation. If supplied, observations are permuted only within
     the specified strata. It is an error to use this when



More information about the Vegan-commits mailing list