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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 5 13:09:47 CET 2011


Author: jarioksa
Date: 2011-01-05 13:09:47 +0100 (Wed, 05 Jan 2011)
New Revision: 1434

Modified:
   pkg/vegan/R/print.cca.R
   pkg/vegan/inst/ChangeLog
Log:
capscale print got back proportions of inertia and a new item Real Total for which the proportions are expressed

Modified: pkg/vegan/R/print.cca.R
===================================================================
--- pkg/vegan/R/print.cca.R	2011-01-03 20:41:28 UTC (rev 1433)
+++ pkg/vegan/R/print.cca.R	2011-01-05 12:09:47 UTC (rev 1434)
@@ -7,18 +7,23 @@
     }
     writeLines(strwrap(pasteCall(x$call)))
     cat("\n")
-    chi <- c(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi,
+    chi <- c(x$tot.chi, if (!is.null(x$CA$imaginary.chi)) x$tot.chi - x$CA$imaginary.chi,
+                            x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi,
              x$CA$imaginary.chi)
-    props <- chi/sum(chi[-1])
-    rnk <- c(NA, x$pCCA$rank, x$CCA$rank, x$CA$rank, x$CA$imaginary.rank)
+    ## Proportions of inertia only for Real dimensions in capscale
+    if (is.null(x$CA$imaginary.chi))
+        props <- chi/chi[1]
+    else
+        props <- c(NA, chi[-c(1, length(chi))]/chi[2], NA)
+    rnk <- c(NA, if (!is.null(x$CA$imaginary.rank)) NA, x$pCCA$rank, x$CCA$rank, x$CA$rank,
+             x$CA$imaginary.rank)
     tbl <- cbind(chi, props, rnk)
     colnames(tbl) <- c("Inertia", "Proportion", "Rank")
-    if (inherits(x, "capscale"))
-        tbl <- tbl[,-2]
-    rn <- c("Total", "Conditional", "Constrained", "Unconstrained",
+    rn <- c("Total", "Real Total",  "Conditional", "Constrained", "Unconstrained",
             "Imaginary")
-    rownames(tbl) <- rn[c(TRUE, !is.null(x$pCCA), !is.null(x$CCA), 
-                          !is.null(x$CA), !is.null(x$CA$imaginary.chi))]
+    rownames(tbl) <- rn[c(TRUE, !is.null(x$CA$imaginary.chi), !is.null(x$pCCA),
+                          !is.null(x$CCA),  !is.null(x$CA),
+                          !is.null(x$CA$imaginary.chi))]
     printCoefmat(tbl, digits = digits, na.print = "")
     cat("Inertia is", x$inertia, "\n")
     if (!is.null(x$CCA$alias))

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-01-03 20:41:28 UTC (rev 1433)
+++ pkg/vegan/inst/ChangeLog	2011-01-05 12:09:47 UTC (rev 1434)
@@ -13,15 +13,17 @@
 	decision, and not a bug. Now I have reconsidered this design
 	decision, and it really seems to me that it was wrong. Now the
 	negative eigenvalues again reduce the total inertia, and are
-	similar as in vegan 1.17-4 and eariler. As a consequence, there
-	will be no proportions of inertia component in capscale(), because
-	there is no information to calculate those proportions.  However,
-	summary.eigenvals() estimates the proportions explained using
-	absolute values of eigenvalues since this seems to make sense
-	there (the proportion explained is now based on absolute
-	eigenvalues to give more sensible output). Moreover, wcmdscale()
-	will now always give goodness of fit (GOF) as NA, since I have no
-	clue how to calculate GOF meaningfully in PCoA. 
+	similar as in vegan 1.17-4 and earlier. The capscale() output got
+	a new item of "Real Total" that gives the sum of eigenvalues
+	without the imaginary component, and the proportions are given
+	only within this real component (if there are negative
+	eigenvalues).  However, summary.eigenvals() estimates the
+	proportions explained using absolute values of eigenvalues since
+	this seems to make sense there (the proportion explained is now
+	based on absolute eigenvalues to give more sensible
+	output). Moreover, wcmdscale() will now always give goodness of
+	fit (GOF) as NA, since I have no clue how to calculate GOF
+	meaningfully in PCoA.
 
 Version 1.18-19 (closed January 3, 2011)
 



More information about the Vegan-commits mailing list