[Vegan-commits] r1484 - in branches/1.17: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 14 08:34:43 CET 2011
Author: jarioksa
Date: 2011-02-14 08:34:42 +0100 (Mon, 14 Feb 2011)
New Revision: 1484
Modified:
branches/1.17/R/eigenvals.R
branches/1.17/inst/ChangeLog
branches/1.17/man/eigenvals.Rd
Log:
merge 1482,3: eigenvals of dudi and labdsv
Modified: branches/1.17/R/eigenvals.R
===================================================================
--- branches/1.17/R/eigenvals.R 2011-02-10 20:38:32 UTC (rev 1483)
+++ branches/1.17/R/eigenvals.R 2011-02-14 07:34:42 UTC (rev 1484)
@@ -78,6 +78,42 @@
out
}
+## dudi objects of ade4
+
+`eigenvals.dudi` <-
+ function(x)
+{
+ out <- x$eig
+ class(out) <- "eigenvals"
+ out
+}
+
+## labdsv::pco
+
+`eigenvals.pco` <-
+ function(x)
+{
+ out <- x$eig
+ class(out) <- "eigenvals"
+ out
+}
+
+## labdsv::pca
+
+`eigenvals.pca` <-
+ function(x)
+{
+ out <- x$sdev^2
+ ## pca() may return only some first eigenvalues
+ if ((seig <- sum(out)) < x$totdev) {
+ names(out) <- paste("PC", seq_along(out), sep="")
+ out <- c(out, "Rest" = x$totdev - seig)
+ }
+ class(out) <- "eigenvals"
+ out
+}
+
+
`print.eigenvals` <-
function(x, ...)
{
Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog 2011-02-10 20:38:32 UTC (rev 1483)
+++ branches/1.17/inst/ChangeLog 2011-02-14 07:34:42 UTC (rev 1484)
@@ -4,6 +4,8 @@
Version 1.17-7 (opened January 10, 2011)
+ * merged r1482,3: eigenvals for ade4 and labdsv.
+
* merged r1476: zip data files.
* merged r1475: partially matched argunments in functions.
Modified: branches/1.17/man/eigenvals.Rd
===================================================================
--- branches/1.17/man/eigenvals.Rd 2011-02-10 20:38:32 UTC (rev 1483)
+++ branches/1.17/man/eigenvals.Rd 2011-02-14 07:34:42 UTC (rev 1484)
@@ -40,8 +40,10 @@
\details{
This is a generic function that has methods for \code{\link{cca}},
- \code{\link{wcmdscale}}, \code{\link{pcnm}}, \code{\link{prcomp}} and
- \code{\link{princomp}} result objects. The default method also
+ \code{\link{wcmdscale}}, \code{\link{pcnm}}, \code{\link{prcomp}},
+ \code{\link{princomp}}, \code{\link[ade4]{dudi}} (of \pkg{ade4}), and
+ \code{\link[labdsv]{pca}} and \code{\link[labdsv]{pco}} (of
+ \pkg{labdsv}) result objects. The default method also
extracts eigenvalues if the result looks like being from
\code{\link{eigen}} or \code{\link{svd}}. Functions
\code{\link{prcomp}} and \code{\link{princomp}} contain square roots
More information about the Vegan-commits
mailing list