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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 16 10:03:55 CET 2010


Author: jarioksa
Date: 2010-02-16 10:03:55 +0100 (Tue, 16 Feb 2010)
New Revision: 1131

Modified:
   pkg/vegan/R/ordistep.R
   pkg/vegan/inst/ChangeLog
Log:
ordistep returns 'anova' item of model history (like step)

Modified: pkg/vegan/R/ordistep.R
===================================================================
--- pkg/vegan/R/ordistep.R	2010-02-16 08:07:05 UTC (rev 1130)
+++ pkg/vegan/R/ordistep.R	2010-02-16 09:03:55 UTC (rev 1131)
@@ -34,6 +34,8 @@
     }
     scope <- factor.scope(ffac, list(add = fadd, drop = fdrop))
     mod <- object
+    ## 'anotab' collects the changes into 'anova' object in the output
+    anotab <- NULL
     for (i in 1:steps){
         change <- NULL
         ## Consider dropping
@@ -49,6 +51,7 @@
                 print(aod)
             }
             if (aod[1,5] > Pout) {
+                anotab <- rbind(anotab, aod[1,])
                 change <- rownames(aod)[1]
                 mod <- eval.parent(update(mod, paste("~  .", change)))
                 scope <- factor.scope(attr(terms(mod), "factors"),
@@ -72,6 +75,7 @@
                 print(aod)
             }
             if (aod[1,5] <= Pin) {
+                anotab <- rbind(anotab, aod[1,])
                 change <- rownames(aod)[1]
                 mod <- eval.parent(update(mod, paste( "~  .",change)))
                 scope <- factor.scope(attr(terms(mod), "factors"),
@@ -87,5 +91,6 @@
             break
     }
     cat("\n")
+    mod$anova <- anotab
     mod
 }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-02-16 08:07:05 UTC (rev 1130)
+++ pkg/vegan/inst/ChangeLog	2010-02-16 09:03:55 UTC (rev 1131)
@@ -4,6 +4,9 @@
 
 Version 1.18-1 (opened February 9, 2010)
 
+	* ordistep: saves model changes in the 'anova' item similarly as
+	standard step(). Experimental feature: not yet documented. 
+
 	* envfit: did not pass weights to factorfit or to vectorfit when
 	the environmental variable was a single vector. Reported for
 	vectors by Richard Telford. Broken in rev1004 (Sep 12, 2009).



More information about the Vegan-commits mailing list