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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 25 08:56:41 CET 2013


Author: jarioksa
Date: 2013-11-25 08:56:41 +0100 (Mon, 25 Nov 2013)
New Revision: 2758

Modified:
   pkg/vegan/R/anovacca.byterm.R
Log:
handle subsets in anovacca

Modified: pkg/vegan/R/anovacca.byterm.R
===================================================================
--- pkg/vegan/R/anovacca.byterm.R	2013-11-25 07:29:25 UTC (rev 2757)
+++ pkg/vegan/R/anovacca.byterm.R	2013-11-25 07:56:41 UTC (rev 2758)
@@ -100,9 +100,18 @@
     Df <- rep(1, length(eig))
     ## Marginal P-values
     LC <- object$CCA$u
+    ## missing values?
     if (!is.null(object$na.action))
         LC <- napredict(structure(object$na.action,
                                   class="exclude"), LC)
+    ## subset?
+    if (!is.null(object$subset)) {
+        tmp <- matrix(NA, nrow=length(object$subset),
+                      ncol = ncol(LC))
+        tmp[object$subset,] <- LC
+        LC <- tmp
+        object <- update(object, subset = object$subset)
+    }
     LC <- as.data.frame(LC)
     fla <- reformulate(names(LC))
     Pvals <- numeric(length(eig))



More information about the Vegan-commits mailing list