[Vegan-commits] r1293 - in pkg/vegan: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 29 16:11:43 CEST 2010


Author: jarioksa
Date: 2010-08-29 16:11:43 +0200 (Sun, 29 Aug 2010)
New Revision: 1293

Modified:
   pkg/vegan/R/ordiR2step.R
   pkg/vegan/man/ordistep.Rd
Log:
ordiR2step returns 'anova' item

Modified: pkg/vegan/R/ordiR2step.R
===================================================================
--- pkg/vegan/R/ordiR2step.R	2010-08-29 06:54:25 UTC (rev 1292)
+++ pkg/vegan/R/ordiR2step.R	2010-08-29 14:11:43 UTC (rev 1293)
@@ -28,6 +28,8 @@
     ## Check that the full model can be evaluated
     if (is.na(R2.all))
         stop("the upper scope cannot be fitted (too many terms?)")
+    ## Collect data to anotab returned as the 'anova' object
+    anotab <-  list()
     ## Step forward and continue as long as R2.adj improves and R2.adj
     ## remains below R2.adj < R2.all
     R2.previous <- R2.0
@@ -74,9 +76,14 @@
             fla <- paste("~  . +", adds[best])
             object <- update(object, fla)
             R2.previous <- RsquareAdj(object)$adj.r.squared
+            anotab <- rbind(anotab, cbind("R2.adj" = R2.previous, tst[2,]))
         } else {
             break
         }
     }
+    rownames(anotab) <- paste("+", rownames(anotab))
+    anotab <- rbind(anotab, "<All variables>" = c(R2.all, rep(NA, 5)))
+    class(anotab) <- c("anova", class(anotab))
+    object$anova <- anotab
     object
 }

Modified: pkg/vegan/man/ordistep.Rd
===================================================================
--- pkg/vegan/man/ordistep.Rd	2010-08-29 06:54:25 UTC (rev 1292)
+++ pkg/vegan/man/ordistep.Rd	2010-08-29 14:11:43 UTC (rev 1293)
@@ -100,7 +100,7 @@
 }
 
 \value{ 
-  Function returns the selected model with one additional
+  Functions 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



More information about the Vegan-commits mailing list