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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 24 14:54:51 CET 2013


Author: jarioksa
Date: 2013-11-24 14:54:51 +0100 (Sun, 24 Nov 2013)
New Revision: 2750

Modified:
   pkg/vegan/R/anovacca.R
Log:
handle null-models without constraints

Modified: pkg/vegan/R/anovacca.R
===================================================================
--- pkg/vegan/R/anovacca.R	2013-11-24 07:56:54 UTC (rev 2749)
+++ pkg/vegan/R/anovacca.R	2013-11-24 13:54:51 UTC (rev 2750)
@@ -33,7 +33,7 @@
     dotargs <- list(...)
     ## we do not want to give dotargs to anova.ccalist, but we
     ## evaluate 'parallel' and 'model' here
-     if (length(dotargs)) {
+    if (length(dotargs)) {
         isCCA <- sapply(dotargs, function(z) inherits(z, "cca"))
         if (any(isCCA)) {
             dotargs <- dotargs[isCCA]
@@ -48,6 +48,10 @@
             return(sol)
         }
     }
+    ## We only have a single model: check if it is empty
+    if (is.null(object$CA) || is.null(object$CCA) ||
+        object$CCA$rank == 0 || object$CA$rank == 0)
+        return(anova.ccanull(object))
     ## by cases
     if (!is.null(by)) {
         by <- match.arg(by, c("terms", "margin", "axis"))



More information about the Vegan-commits mailing list