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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 11 15:05:42 CET 2013


Author: jarioksa
Date: 2013-01-11 15:05:42 +0100 (Fri, 11 Jan 2013)
New Revision: 2361

Modified:
   pkg/vegan/R/capscale.R
Log:
imaginary axes need similar adjustment as eigenvalues in capscale

Modified: pkg/vegan/R/capscale.R
===================================================================
--- pkg/vegan/R/capscale.R	2013-01-10 17:53:14 UTC (rev 2360)
+++ pkg/vegan/R/capscale.R	2013-01-11 14:05:42 UTC (rev 2361)
@@ -88,8 +88,13 @@
     if (is.null(rownames(X$points))) 
         rownames(X$points) <- nm
     X$points <- adjust * X$points
-    if (adjust == 1)
+    ## We adjust eigenvalues to variances, and simultaneously the
+    ## possible negative axes must be adjusted similarly
+    if (adjust == 1) {
         X$eig <- X$eig/k
+        if (!is.null(X$negaxes))
+            X$negaxes <- X$negaxes/sqrt(k)
+    }
     sol <- rda.default(X$points, d$Y, d$Z, ...)
     if (!is.null(sol$CCA) && sol$CCA$rank > 0) {
         colnames(sol$CCA$u) <- colnames(sol$CCA$biplot) <- names(sol$CCA$eig) <-



More information about the Vegan-commits mailing list