[Vegan-commits] r1432 - in pkg/vegan: . R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 3 18:54:26 CET 2011
Author: jarioksa
Date: 2011-01-03 18:54:26 +0100 (Mon, 03 Jan 2011)
New Revision: 1432
Modified:
pkg/vegan/DESCRIPTION
pkg/vegan/R/capscale.R
pkg/vegan/R/eigenvals.R
pkg/vegan/R/print.cca.R
pkg/vegan/R/wcmdscale.R
pkg/vegan/inst/ChangeLog
Log:
rethinking handling of negative eigenvalues in capscale (and wcmdscale)
Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/DESCRIPTION 2011-01-03 17:54:26 UTC (rev 1432)
@@ -1,7 +1,7 @@
Package: vegan
Title: Community Ecology Package
-Version: 1.18-19
-Date: December 18, 2010
+Version: 1.18-20
+Date: January 3, 2011
Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre,
R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens,
Helene Wagner
Modified: pkg/vegan/R/capscale.R
===================================================================
--- pkg/vegan/R/capscale.R 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/R/capscale.R 2011-01-03 17:54:26 UTC (rev 1432)
@@ -92,7 +92,7 @@
names(negax) <- paste("NEG", seq_along(negax), sep="")
sol$CA$eig <- c(sol$CA$eig, negax)
sol$CA$imaginary.chi <- sum(negax)
- sol$tot.chi <- sol$tot.chi + abs(sol$CA$imaginary.chi)
+ sol$tot.chi <- sol$tot.chi + sol$CA$imaginary.chi
sol$CA$imaginary.rank <- length(negax)
sol$CA$imaginary.u.eig <- X$negaxes
}
Modified: pkg/vegan/R/eigenvals.R
===================================================================
--- pkg/vegan/R/eigenvals.R 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/R/eigenvals.R 2011-01-03 17:54:26 UTC (rev 1432)
@@ -92,7 +92,7 @@
## capscale
vars <- object/sum(abs(object))
importance <- rbind(`Eigenvalue` = object,
- `Proportion Explained` = round(vars, 5),
+ `Proportion Explained` = round(abs(vars), 5),
`Cumulative Proportion`= round(cumsum(abs(vars)), 5))
out <- list(importance = importance)
class(out) <- c("summary.eigenvals", "summary.prcomp")
Modified: pkg/vegan/R/print.cca.R
===================================================================
--- pkg/vegan/R/print.cca.R 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/R/print.cca.R 2011-01-03 17:54:26 UTC (rev 1432)
@@ -9,10 +9,12 @@
cat("\n")
chi <- c(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi,
x$CA$imaginary.chi)
- props <- abs(chi)/sum(abs(chi[-1]))
+ props <- chi/sum(chi[-1])
rnk <- c(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",
"Imaginary")
rownames(tbl) <- rn[c(TRUE, !is.null(x$pCCA), !is.null(x$CCA),
Modified: pkg/vegan/R/wcmdscale.R
===================================================================
--- pkg/vegan/R/wcmdscale.R 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/R/wcmdscale.R 2011-01-03 17:54:26 UTC (rev 1432)
@@ -49,7 +49,7 @@
sum(ev)/sum(e$values[e$values > 0]))
if (eig || x.ret || add) {
out <- list(points = points, eig = if (eig) e$values,
- x = if (x.ret) m, ac = NA, GOF = GOF, weights = w,
+ x = if (x.ret) m, ac = NA, GOF = NA, weights = w,
negaxes = negaxes)
class(out) <- "wcmdscale"
}
Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog 2011-01-03 17:07:11 UTC (rev 1431)
+++ pkg/vegan/inst/ChangeLog 2011-01-03 17:54:26 UTC (rev 1432)
@@ -2,8 +2,29 @@
VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
-Version 1.18-19 (opened December 18, 2010)
+Version 1.18-20 (opened January 3, 2011)
+ * capscale: the total inertia was defined as the sum of absolute
+ values of inertia so that negative eigenvalues of imaginary
+ dimensions increase inertia (changes in 1.18-17 and release
+ 1.17-5). Torsten Hauffe reported this as a bug in vegan
+ open-discussion forum in R-Forge on Dec 22, 2010. I (JO) answered
+ on Jan 1, 2011 and justified the change, and said this is a design
+ 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.
+
+Version 1.18-19 (closed January 3, 2011)
+
* new version opened with the release of vegan 1.17-5 (submitted
Dec 17, 2010, released at CRAN on on Dec 18, 2010).
@@ -12,7 +33,7 @@
* wascores: checks input -- weights (species abundances) must be
non-negative and not all zero.
-
+
* metaMDS: function was written for community data with all
entries non-negative, but it is used increasingly often with other
data types with a risk of failure (especially in wascores()). Now
More information about the Vegan-commits
mailing list