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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 10 09:46:24 CET 2010


Author: jarioksa
Date: 2010-11-10 09:46:24 +0100 (Wed, 10 Nov 2010)
New Revision: 1358

Modified:
   pkg/vegan/R/eigenvals.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/eigenvals.Rd
Log:
add eigenvals.pcnm, tidy up and expand docs on negative eigenvals

Modified: pkg/vegan/R/eigenvals.R
===================================================================
--- pkg/vegan/R/eigenvals.R	2010-11-10 08:16:48 UTC (rev 1357)
+++ pkg/vegan/R/eigenvals.R	2010-11-10 08:46:24 UTC (rev 1358)
@@ -52,7 +52,7 @@
    else
        out <- c(x$CCA$eig, x$CA$eig)
    if (!is.null(out))
-       class(out) <- c("eigenvals")
+       class(out) <- "eigenvals"
    out
 }
 
@@ -61,10 +61,19 @@
     function(x, ...)
 {
     out <- x$eig
-    class(out) <-"eigenvals"
+    class(out) <- "eigenvals"
     out
 }
 
+## pcnm (in vegan)
+`eigenvals.pcnm` <-
+    function(x, ...)
+{
+    out <- x$values
+    class(out) <- "eigenvals"
+    out
+}
+
 `print.eigenvals` <-
     function(x, ...)
 {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-11-10 08:16:48 UTC (rev 1357)
+++ pkg/vegan/inst/ChangeLog	2010-11-10 08:46:24 UTC (rev 1358)
@@ -4,6 +4,9 @@
 
 Version 1.18-16 (opened November 9, 20109
 
+	* eigenvals: added a method for "pcnm" and docs discuss handling
+	negative eigenvalues in summary.eigenvals().
+
 	* prc: Cajo ter Braak wrote new code for more direct
 	implementation of PRC. This drops formula interface and directly
 	finds model matrices avoiding aliased terms.

Modified: pkg/vegan/man/eigenvals.Rd
===================================================================
--- pkg/vegan/man/eigenvals.Rd	2010-11-10 08:16:48 UTC (rev 1357)
+++ pkg/vegan/man/eigenvals.Rd	2010-11-10 08:46:24 UTC (rev 1358)
@@ -6,6 +6,7 @@
 \alias{eigenvals.princomp}
 \alias{eigenvals.cca}
 \alias{eigenvals.wcmdscale}
+\alias{eigenvals.pcnm}
 \alias{print.eigenvals}
 \alias{summary.eigenvals}
 
@@ -39,7 +40,7 @@
 
 \details{
   This is a generic function that has methods for \code{\link{cca}},
-  \code{\link{wcmdscale}}, \code{\link{prcomp}} and
+  \code{\link{wcmdscale}}, \code{\link{pcnm}}, \code{\link{prcomp}} and
   \code{\link{princomp}} result objects. The default method also
   extracts eigenvalues if the result looks like being from
   \code{\link{eigen}} or \code{\link{svd}}.  Functions
@@ -55,7 +56,14 @@
   \code{constrained = TRUE} only constrained eigenvalues are returned. 
 
   The \code{summary} of \code{eigenvals} result returns eigenvalues,
-  proportion explained and cumulative proportion explained.
+  proportion explained and cumulative proportion explained. The result
+  object can have some negative eigenvalues (\code{\link{wcmdscale}},
+  \code{\link{capscale}}, \code{\link{pcnm}}) which correspond to
+  imaginary axes of Euclidean mapping of non-Euclidean distances
+  (Gower 1985). In these cases, the sum of absolute values of
+  eigenvalues is used in calculating the proportions explained, and
+  real axes (corresponding to positive eigenvalues) will only explain
+  a part of total variation (Mardia et al. 1979, Gower 1985).  
 }
 
 \value{
@@ -65,7 +73,15 @@
 \author{
  Jari Oksanen.
 }
+\references{
+  Gower, J. C. (1985). Properties of Euclidean and non-Euclidean
+  distance matrices. \emph{Linear Algebra and its Applications} 67,
+  81--97.
 
+  Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979).  Chapter 14 of
+  \emph{Multivariate Analysis}, London: Academic Press.
+}
+
 \seealso{
  \code{\link{eigen}}, \code{\link{svd}}, \code{\link{prcomp}},
  \code{\link{princomp}}, \code{\link{cca}}, \code{\link{rda}},



More information about the Vegan-commits mailing list