[Vegan-commits] r1295 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 30 15:21:25 CEST 2010


Author: jarioksa
Date: 2010-08-30 15:21:25 +0200 (Mon, 30 Aug 2010)
New Revision: 1295

Modified:
   pkg/vegan/R/ordiR2step.R
Log:
ordiR2step adds 'anova' only if terms were added

Modified: pkg/vegan/R/ordiR2step.R
===================================================================
--- pkg/vegan/R/ordiR2step.R	2010-08-29 14:13:48 UTC (rev 1294)
+++ pkg/vegan/R/ordiR2step.R	2010-08-30 13:21:25 UTC (rev 1295)
@@ -81,9 +81,11 @@
             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
+    if (NROW(anotab) > 0) {
+        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
 }



More information about the Vegan-commits mailing list