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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 29 08:21:51 CEST 2011


Author: jarioksa
Date: 2011-05-29 08:21:50 +0200 (Sun, 29 May 2011)
New Revision: 1613

Modified:
   pkg/vegan/R/capscale.R
   pkg/vegan/inst/ChangeLog
Log:
update() of capscale() failed: I hope this fix does not break other things

Modified: pkg/vegan/R/capscale.R
===================================================================
--- pkg/vegan/R/capscale.R	2011-05-28 14:21:28 UTC (rev 1612)
+++ pkg/vegan/R/capscale.R	2011-05-29 06:21:50 UTC (rev 1613)
@@ -13,11 +13,10 @@
         data <- ordiGetData(match.call(), environment(formula))
     }
     formula <- formula(terms(formula, data = data))
-    ## the following line fails in update() of a previously fitted
-    ## model because it is eval'ed in environment(formula), but works
-    ## when eval'ed in the default environment -- need to test if the
-    ## environment(formula) is necessary
-    X <- eval(formula[[2]], environment(formula))
+    ## The following line was eval'ed in environment(formula), but
+    ## that made update() fail. Rethink the line if capscale() fails
+    ## mysteriously at this point.
+    X <- eval(formula[[2]]) #, environment(formula))
     if (!inherits(X, "dist")) {
         comm <- X
         dfun <- match.fun(dfun)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-05-28 14:21:28 UTC (rev 1612)
+++ pkg/vegan/inst/ChangeLog	2011-05-29 06:21:50 UTC (rev 1613)
@@ -9,10 +9,13 @@
 	index that Whittaker suggested to estimate beta diversity.
 
 	* capscale: species scores will be NA if input data were
-	dissimilarities and no 'comm' was given. (BTW, if input data were
-	dissimilarities, update() will fail! -- I don't know why, but
-	anybody can fix this.)
-
+	dissimilarities and no 'comm' was given. update(capscale_result)
+	failed because LHS data were evaluated in the
+	environment(formula).  Now removed the explicit environment: I ran
+	some tests and found no problems, but let's see what the real life
+	brings along. The changed point is commented so that this change
+	can be reconsidered if necessary.
+	
 	* oecosimu: reverted r1557 of version 1.18-26, or splitting tied
 	values. This was introduced because Chase et al. (Ecosphere 2011,
 	http://www.esajournals.org/doi/pdf/10.1890/ES10-00117.1) used this



More information about the Vegan-commits mailing list