[Vegan-commits] r2287 - in pkg/vegan: . R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 16 16:13:16 CEST 2012


Author: jarioksa
Date: 2012-09-16 16:13:16 +0200 (Sun, 16 Sep 2012)
New Revision: 2287

Modified:
   pkg/vegan/DESCRIPTION
   pkg/vegan/R/anova.ccabyaxis.R
   pkg/vegan/R/anova.ccabyterm.R
   pkg/vegan/inst/ChangeLog
Log:
Fix scoping issues in anova(<cca.object>, by=...) cases

This fixes two scoping issues raised by Sven Neulinger:

Date: Sat, 15 Sep 2012 17:12:49 +0200
From: Sven Neulinger <sneulinger at ifam.uni-kiel.de>
To: <jari.oksanen at oulu.fi>

When using the anova.cca() command with argument (1) by="axis" and (2) 
by="terms", respectively, on a partial db-RDA object built with 
capscale(), I get the following error messages:

(1) "Error in eval(expr, envir, enclos) : object 'CondMat' not found";
(2) "Error in model.frame.default(P.formula, data, na.action = na.pass, 
xlev = zlev) : object is not a matrix"

Argument (2) also leads to error message (2) with partial RDA using 
rda() on the same data.



Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION	2012-09-16 05:18:14 UTC (rev 2286)
+++ pkg/vegan/DESCRIPTION	2012-09-16 14:13:16 UTC (rev 2287)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 2.1-19
-Date: August 20, 2012
+Version: 2.1-20
+Date: September 16, 2012
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, 
    M. Henry H. Stevens, Helene Wagner  

Modified: pkg/vegan/R/anova.ccabyaxis.R
===================================================================
--- pkg/vegan/R/anova.ccabyaxis.R	2012-09-16 05:18:14 UTC (rev 2286)
+++ pkg/vegan/R/anova.ccabyaxis.R	2012-09-16 14:13:16 UTC (rev 2287)
@@ -51,8 +51,10 @@
     environment(object$terms) <- environment()
     fla <- paste(". ~ ", axnam[1], "+ Condition(",
                  paste(axnam[-1], collapse="+"),")")
-    if (!is.null(CondMat))
+    if (!is.null(CondMat)) {
         fla <- paste(fla, " + Condition(CondMat)")
+        lc$CondMat <- CondMat
+    }
     fla <- update(formula(object), fla)
     sol <- anova(update(object, fla, data=lc),  ...)
     out[c(1, rnk + 1), ] <- sol

Modified: pkg/vegan/R/anova.ccabyterm.R
===================================================================
--- pkg/vegan/R/anova.ccabyterm.R	2012-09-16 05:18:14 UTC (rev 2286)
+++ pkg/vegan/R/anova.ccabyterm.R	2012-09-16 14:13:16 UTC (rev 2287)
@@ -28,7 +28,7 @@
     if (!is.null(object$call$data))
         modelframe <- ordiGetData(object$call, globalenv())
     else
-        modelframe <- NULL
+        modelframe <- model.frame(object)
     for (.ITRM in ntrm:2) {
         if (ntrm < 2) 
             break

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-09-16 05:18:14 UTC (rev 2286)
+++ pkg/vegan/inst/ChangeLog	2012-09-16 14:13:16 UTC (rev 2287)
@@ -2,8 +2,21 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
-Version 2.1-19 (opened August 20, 2012)
+Version 2.1-20 (opened September 16, 2012)
 
+	* anova.cca: Dr Sven Neulinger (Christian Albrecht University,
+	Kiel, Germany) reported several problems with anova.cca cases. All
+	these were problems in scoping. Two problems solved with this
+	commit were: (1) anova.cca(..., by = "axis") always failed in
+	partial analysis (with conditions), (2) anova.cca(..., by =
+	"term") failed in partial models when there was no 'data='
+	argument, but the variables were in the global workspace. In
+	addition, there is one unsolved problem with search order:
+	stats function C() is found instead of variable 'C' and this gives
+	an error message  "object is not a matrix".
+	
+Version 2.1-19 (closed September 16, 2012)
+
 	* adonis: Small changes in calculations. Simplified calculations
 	of matrix G as centred distance matrix, and does not keep n x n
 	matrices that are not needed (A) or used only once (identity



More information about the Vegan-commits mailing list