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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 21 09:59:20 CEST 2010


Author: jarioksa
Date: 2010-05-21 09:59:19 +0200 (Fri, 21 May 2010)
New Revision: 1188

Modified:
   pkg/vegan/R/ordiresids.R
   pkg/vegan/inst/ChangeLog
Log:
ordiresids now deweights Residuals and Fitted in CA

Modified: pkg/vegan/R/ordiresids.R
===================================================================
--- pkg/vegan/R/ordiresids.R	2010-05-21 07:11:22 UTC (rev 1187)
+++ pkg/vegan/R/ordiresids.R	2010-05-21 07:59:19 UTC (rev 1188)
@@ -8,6 +8,12 @@
         stop("function is only available for constrained ordination")
     fit <- fitted(x, type = residuals)
     res <- residuals(x, type = residuals)
+    ## remove the effects of row weights in CA
+    if (!inherits(x, "rda")) {
+        sqr <- sqrt(x$rowsum)
+        fit <- sweep(fit, 1, sqr, "*")
+        res <- sweep(res, 1, sqr, "*")
+    }
     colnam <- rep(colnames(fit), each=nrow(fit))
     rownam <- rep(rownames(fit), ncol(fit))
     df <- data.frame(Fitted = as.vector(fit), Residuals = as.vector(res))

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-05-21 07:11:22 UTC (rev 1187)
+++ pkg/vegan/inst/ChangeLog	2010-05-21 07:59:19 UTC (rev 1188)
@@ -4,6 +4,11 @@
 
 Version 1.18-5 (opened May 21, 2010)
 
+	* ordiresids: removes now the row weights from Residuals and
+	Fitted in CA. Now shows the same values that are shuffled or
+	resampled in simulate.cca() where they are again weighted after
+	being added to the new fitted value.
+
 	* mantel.correlog: changes the Sturge's rule to conform with the
 	standard R nclass.Sturges ('ceiling' instead of 'round'. Extends
 	and corrects documentation and messages.



More information about the Vegan-commits mailing list