[Vegan-commits] r343 - in pkg: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 9 15:16:59 CEST 2008


Author: jarioksa
Date: 2008-05-09 15:16:59 +0200 (Fri, 09 May 2008)
New Revision: 343

Added:
   pkg/R/print.capscale.R
Modified:
   pkg/DESCRIPTION
   pkg/R/capscale.R
   pkg/inst/ChangeLog
   pkg/man/capscale.Rd
Log:
capscale uses metaMDSdist transformed data fro species scores and prints info on transfo

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-05-09 12:58:18 UTC (rev 342)
+++ pkg/DESCRIPTION	2008-05-09 13:16:59 UTC (rev 343)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.12-14
-Date: May 7, 2008
+Version: 1.12-15
+Date: May 9, 2008
 Author: Jari Oksanen, Roeland Kindt, Pierre Legendre, Bob O'Hara, Gavin L. Simpson, 
   M. Henry H. Stevens  
 Maintainer: Jari Oksanen <jari.oksanen at oulu.fi>

Modified: pkg/R/capscale.R
===================================================================
--- pkg/R/capscale.R	2008-05-09 12:58:18 UTC (rev 342)
+++ pkg/R/capscale.R	2008-05-09 13:16:59 UTC (rev 343)
@@ -17,8 +17,11 @@
         comm <- X
         dfun <- match.fun(dfun)
         if (metaMDSdist) {
+            commname <- as.character(formula[[2]])
             X <- metaMDSdist(comm, distance = distance, zerodist = "ignore",
-                             distfun = dfun, ...)
+                             commname = commname, distfun = dfun, ...)
+            commname <- attr(X, "commname")
+            comm <- eval.parent(parse(text=commname))
         } else {
             X <- dfun(X, distance)
         }
@@ -52,12 +55,13 @@
     sol <- rda.default(d$X, d$Y, d$Z, ...)
     sol$tot.chi <- sol$tot.chi
     if (!is.null(sol$CCA)) {
-        colnames(sol$CCA$u) <- colnames(sol$CCA$biplot) <- names(sol$CCA$eig) <- colnames(sol$CCA$wa) <- colnames(sol$CCA$v) <- paste("CAP", 
-                                                                                                                                      1:ncol(sol$CCA$u), sep = "")
+        colnames(sol$CCA$u) <- colnames(sol$CCA$biplot) <- names(sol$CCA$eig) <-
+            colnames(sol$CCA$wa) <- colnames(sol$CCA$v) <-
+                paste("CAP", 1:ncol(sol$CCA$u), sep = "")
     }
     if (!is.null(sol$CA)) {
-        colnames(sol$CA$u) <- names(sol$CA$eig) <- colnames(sol$CA$v) <- paste("MDS", 
-                                                                               1:ncol(sol$CA$u), sep = "")
+        colnames(sol$CA$u) <- names(sol$CA$eig) <- colnames(sol$CA$v) <-
+            paste("MDS", 1:ncol(sol$CA$u), sep = "")
     }
     if (!is.null(comm)) {
         comm <- scale(comm, center = TRUE, scale = FALSE)
@@ -92,6 +96,8 @@
     sol$call$formula[[2]] <- formula[[2]]
     sol$method <- "capscale"
     sol$inertia <- inertia
+    if (metaMDSdist)
+        sol$metaMDSdist <- commname
     class(sol) <- c("capscale", class(sol))
     sol
 }

Added: pkg/R/print.capscale.R
===================================================================
--- pkg/R/print.capscale.R	                        (rev 0)
+++ pkg/R/print.capscale.R	2008-05-09 13:16:59 UTC (rev 343)
@@ -0,0 +1,7 @@
+`print.capscale` <-
+    function(x, ...)
+{
+    NextMethod("print", x, ...)
+    if (!is.null(x$metaMDSdist))
+        cat("metaMDSdist transformed data:", x$metaMDSdist, "\n\n") 
+}

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-05-09 12:58:18 UTC (rev 342)
+++ pkg/inst/ChangeLog	2008-05-09 13:16:59 UTC (rev 343)
@@ -2,12 +2,22 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
-Version 1.12-14 (opened May 7, 2008)
+Version 1.12-15 (opened May 9, 2008)
 
+	* capscale: prints info on possible metaMDS transformations, and
+	uses metaMDSdist transformed data for getting species scores
+	(similarly as metaMDS recently does).
+
+	* ordiTerminfo: does not give superfluos warnings if constrained
+	ordination called without constraints and without data=, like
+	capscale(x ~ 1).
+
+Version 1.12-14 (closed May 9, 2008)
+
 	* mso: added Helene Wagner's mso function for direct multi-scale
-	ordination with constrained ordination or spatial partioning of
-	'cca' and 'rda' results (Ecology 85, 342-351; 2004). Thanks to
-	Helene Wagner for allowing the inclusion of the code.
+	ordination or spatial partioning of 'cca' and 'rda'
+	results (Ecology 85, 342-351; 2004). Thanks to Helene Wagner for
+	allowing the inclusion of the code.
 
 	* MOStest: new function to implement Mitchell-Olds & Shaw test for
 	the location of quadratic extreme in a defined interval.

Modified: pkg/man/capscale.Rd
===================================================================
--- pkg/man/capscale.Rd	2008-05-09 12:58:18 UTC (rev 342)
+++ pkg/man/capscale.Rd	2008-05-09 13:16:59 UTC (rev 343)
@@ -1,5 +1,6 @@
 \name{capscale}
 \alias{capscale}
+\alias{print.capscale}
 
 \title{[Partial] Constrained Analysis of Principal Coordinates or
   distance-based RDA }



More information about the Vegan-commits mailing list