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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 5 16:20:39 CET 2013


Author: jarioksa
Date: 2013-02-05 16:20:38 +0100 (Tue, 05 Feb 2013)
New Revision: 2413

Modified:
   pkg/vegan/R/predict.cca.R
   pkg/vegan/R/predict.rda.R
   pkg/vegan/inst/ChangeLog
Log:
pCCA component handled both in type='resp' and type='work' in cca() and rda() results

Modified: pkg/vegan/R/predict.cca.R
===================================================================
--- pkg/vegan/R/predict.cca.R	2013-02-05 11:38:37 UTC (rev 2412)
+++ pkg/vegan/R/predict.cca.R	2013-02-05 15:20:38 UTC (rev 2413)
@@ -34,7 +34,7 @@
         rc <- outer(rs, cs)
         if (type == "response") {
             if (!is.null(object$pCCA)) 
-                warning("Conditional ('partial') component ignored")
+                Xbar <- Xbar + object$pCCA$Fit / sqrt(rc)
             out <- (Xbar + 1) * rc * gtot
         } else {                # type == "working"
             out <- Xbar * sqrt(rc)

Modified: pkg/vegan/R/predict.rda.R
===================================================================
--- pkg/vegan/R/predict.rda.R	2013-02-05 11:38:37 UTC (rev 2412)
+++ pkg/vegan/R/predict.rda.R	2013-02-05 15:20:38 UTC (rev 2413)
@@ -30,6 +30,8 @@
                          newdata = newdata, rank = take)
         }
         if (inherits(object, "capscale")) {
+            if (!is.null(object$pCCA))
+                warning("Conditional ('partial') component ignored")
             if (take > 0) {
                 out <- u %*% slam/sqrt(nr)
                 if (type == "response") {
@@ -54,7 +56,7 @@
                     out <- out + object$pCCA$Fit
             } else {
                 if (!is.null(object$pCCA)) 
-                    warning("Conditional ('partial') component ignored")
+                    out <- out + object$pCCA$Fit
                 out <- out/sqrt(nrow(out) - 1)
             }
         }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-02-05 11:38:37 UTC (rev 2412)
+++ pkg/vegan/inst/ChangeLog	2013-02-05 15:20:38 UTC (rev 2413)
@@ -9,10 +9,11 @@
 	approximately. Please comment and correct.
 
 	* predict.rda, predict.cca: The partial term is handled in
-	predict.rda(..., type = "response") and in predict.cca(..., type =
-	"working").  The partial term was earlier handled only in
-	corresponding simulate.rda(), simulate.cca() functions, but it was
-	now moved to these more basic functions.
+	predict(..., type = "response") and in predict(..., type =
+	"working") for cca() and rda() result objects.  The partial term
+	was earlier handled only in corresponding simulate.rda(),
+	simulate.cca() functions, but it was now moved to these more basic
+	functions. The partial capscale() results are still unhandled.
 
 	* oecosimu: changed the structure of the oecosimu() result
 	object. It now returns a list of two items: "statistic" is the



More information about the Vegan-commits mailing list