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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 29 16:07:49 CEST 2011


Author: jarioksa
Date: 2011-05-29 16:07:49 +0200 (Sun, 29 May 2011)
New Revision: 1614

Modified:
   pkg/vegan/R/ordiR2step.R
   pkg/vegan/inst/ChangeLog
Log:
ordiR2step() is more informative for the reasons it refuses to build a model

Modified: pkg/vegan/R/ordiR2step.R
===================================================================
--- pkg/vegan/R/ordiR2step.R	2011-05-29 06:21:50 UTC (rev 1613)
+++ pkg/vegan/R/ordiR2step.R	2011-05-29 14:07:49 UTC (rev 1614)
@@ -23,10 +23,15 @@
         scope <- delete.response(formula(scope))
     if (!inherits(scope, "formula"))
         scope <- reformulate(scope)
-    R2.all <- RsquareAdj(update(object, scope))$adj.r.squared
+    R2.all <- RsquareAdj(update(object, scope))
     ## Check that the full model can be evaluated
-    if (is.na(R2.all))
-        stop("the upper scope cannot be fitted (too many terms?)")
+    if (is.na(R2.all$adj.r.squared)) {
+        if (R2.all$r.squared > 0.999)
+            stop("the upper scope cannot be fitted (too many terms?)")
+        else
+            stop("upper scope cannot be fitted (Condition() in scope?)")
+    }
+    R2.all <- R2.all$adj.r.squared
     ## Collect data to anotab returned as the 'anova' object
     anotab <-  list()
     ## Step forward and continue as long as R2.adj improves and R2.adj

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-05-29 06:21:50 UTC (rev 1613)
+++ pkg/vegan/inst/ChangeLog	2011-05-29 14:07:49 UTC (rev 1614)
@@ -4,6 +4,10 @@
 
 Version 1.18-31 (opened May 26, 2011)
 
+	* ordiR2step: more informative about rejecting 'scope': partial
+	models are not (currently) accepted due to the design of
+	RsquareAdj.rda().
+
 	* specnumber: gained argument 'groups' to find total richness
 	within each group. An example shows how to use this to find one
 	index that Whittaker suggested to estimate beta diversity.



More information about the Vegan-commits mailing list