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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 25 13:13:31 CEST 2010


Author: jarioksa
Date: 2010-08-25 13:13:31 +0200 (Wed, 25 Aug 2010)
New Revision: 1282

Modified:
   pkg/vegan/R/ordiR2step.R
   pkg/vegan/inst/ChangeLog
Log:
ordiR2step was not able to add all variables of the scope

Modified: pkg/vegan/R/ordiR2step.R
===================================================================
--- pkg/vegan/R/ordiR2step.R	2010-08-25 09:37:03 UTC (rev 1281)
+++ pkg/vegan/R/ordiR2step.R	2010-08-25 11:13:31 UTC (rev 1282)
@@ -5,6 +5,8 @@
 `ordiR2step` <-
     function(object, scope, trace = TRUE)
 {
+    if (missing(scope))
+        stop("needs scope")
     ## Works only for rda(): cca() does not have (yet) R2.adjusted
     if (!inherits(object, "rda"))
         stop("can be used only with rda() or capscale()")
@@ -30,6 +32,9 @@
     R2.previous <- R2.0
     repeat {
         adds <- add.scope(object, scope)
+        ## Nothing to add, and we're done: break
+        if (length(adds) == 0)
+            break
         R2.adds <- numeric(length(adds))
         names(R2.adds) <- adds
         ## Loop over add scope

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-08-25 09:37:03 UTC (rev 1281)
+++ pkg/vegan/inst/ChangeLog	2010-08-25 11:13:31 UTC (rev 1282)
@@ -15,6 +15,9 @@
 
 	* biplot.CCorA: resets par that it sets.
 
+	* ordiR2step: can go to the end and include all variables of the
+	scope (and checks there is a scope).
+
 	* permutest.cca: defaults to 99 permutations instead of 100 (to
 	be consistent). Item 'call' now stores the call to permutest()
 	instead of the call of the ordination which is now saved in



More information about the Vegan-commits mailing list