[Vegan-commits] r1168 - in branches/1.17: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 4 17:00:04 CET 2010


Author: jarioksa
Date: 2010-03-04 17:00:04 +0100 (Thu, 04 Mar 2010)
New Revision: 1168

Modified:
   branches/1.17/R/ordistep.R
   branches/1.17/inst/ChangeLog
   branches/1.17/man/ordistep.Rd
Log:
merge r1131 & 1165: add 'anova' item to the result object

Modified: branches/1.17/R/ordistep.R
===================================================================
--- branches/1.17/R/ordistep.R	2010-03-04 15:56:36 UTC (rev 1167)
+++ branches/1.17/R/ordistep.R	2010-03-04 16:00:04 UTC (rev 1168)
@@ -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: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-03-04 15:56:36 UTC (rev 1167)
+++ branches/1.17/inst/ChangeLog	2010-03-04 16:00:04 UTC (rev 1168)
@@ -4,6 +4,9 @@
 
 Version 1.17-2
 
+	* ordistep: merged r1131, 1165 (adds 'anova' item to the result
+	object). 
+
 	* densityplot.oecosimu: merged r1164 (warnings when there was only
 	one statistic and hence one lattice panel).
 

Modified: branches/1.17/man/ordistep.Rd
===================================================================
--- branches/1.17/man/ordistep.Rd	2010-03-04 15:56:36 UTC (rev 1167)
+++ branches/1.17/man/ordistep.Rd	2010-03-04 16:00:04 UTC (rev 1168)
@@ -57,7 +57,7 @@
 \details{
   The basic functions for model choice in constrained ordination are
   \code{\link{add1.cca}} and \code{\link{drop1.cca}}. With these functions,
-  ordination models can be chosen with standard \R\ function 
+  ordination models can be chosen with standard \R function 
   \code{\link{step}} which bases the term choice on AIC. AIC-like 
   statistics for ordination are provided by functions 
   \code{\link{deviance.cca}} and \code{\link{extractAIC.cca}} (with 
@@ -76,8 +76,13 @@
   is often sensible to have \code{Pout} \eqn{>} \code{Pin} in stepwise
   models to avoid cyclic adds and drops of single terms. 
 }
-\value{
-  Function returns the chosen model.
+
+\value{ 
+  Function returns the selected model with one additional
+  component, \code{anova}, which contains brief information of steps
+  taken. You can suppress voluminous output during model building by
+  setting \code{trace = FALSE}, and find the summary of model history
+  in the \code{anova} item.  
 }
 
 \author{



More information about the Vegan-commits mailing list