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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 8 21:16:44 CET 2013


Author: jarioksa
Date: 2013-01-08 21:16:44 +0100 (Tue, 08 Jan 2013)
New Revision: 2350

Modified:
   pkg/vegan/DESCRIPTION
   pkg/vegan/R/capscale.R
   pkg/vegan/inst/ChangeLog
Log:
bugfix in capscale: species scores were wrongly scaled with other than Euclidean distances

Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION	2013-01-08 16:52:55 UTC (rev 2349)
+++ pkg/vegan/DESCRIPTION	2013-01-08 20:16:44 UTC (rev 2350)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 2.1-22
-Date: November 19, 2012
+Version: 2.1-23
+Date: January 8, 2013
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    Peter R. Minchin, 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	2013-01-08 16:52:55 UTC (rev 2349)
+++ pkg/vegan/R/capscale.R	2013-01-08 20:16:44 UTC (rev 2350)
@@ -122,14 +122,12 @@
             comm <- qr.resid(sol$pCCA$QR, comm)
         if (!is.null(sol$CCA) && sol$CCA$rank > 0) {
             sol$CCA$v.eig <- t(comm) %*% sol$CCA$u/sqrt(k)
-            sol$CCA$v <- sweep(sol$CCA$v.eig, 2, sqrt(sol$CCA$eig), 
-                               "/")
+            sol$CCA$v <- decostand(sol$CCA$v.eig, "normalize", MARGIN = 2)
             comm <- qr.resid(sol$CCA$QR, comm)
         }
         if (!is.null(sol$CA) && sol$CA$rank > 0) {
             sol$CA$v.eig <- t(comm) %*% sol$CA$u/sqrt(k)
-            sol$CA$v <- sweep(sol$CA$v.eig, 2, sqrt(sol$CA$eig[1:poseig]), 
-                              "/")
+            sol$CA$v <- decostand(sol$CA$v.eig, "normalize", MARGIN = 2)
         }
     } else {
         ## input data were dissimilarities, and no 'comm' defined:

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-01-08 16:52:55 UTC (rev 2349)
+++ pkg/vegan/inst/ChangeLog	2013-01-08 20:16:44 UTC (rev 2350)
@@ -2,12 +2,21 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
-Version 2.1-22 (opened November 19, 2012)
+Version 2.1-23 (opened January 8, 2013)
 
-	* Bugfix in multipart: argument global was printed as TRUE
-	regardless of the actual argument value. This did not affect
-	calculations. Reported by Valerie Coudrain.
+	* capscale: It was wrongly assumed that eigenvalues could
+	be used in normalization of species scores, but this worked only
+	with Euclidean distances. Now normalization is done explicitly
+	with decostand() function. This change means that scaling of
+	species scores will change, and graphs can look different than
+	previously. All analyses should be redone. 
+	
+Version 2.1-22 (closed January 8, 2013)
 
+	* multipart: argument global was printed as TRUE regardless of the
+	actual argument value. This did not affect calculations. Reported
+	by Valerie Coudrain.
+
 	* monoMDS, metaMDS: Default convergence criteria were changed in
 	monoMDS. Most importantly, now scale factor of the gradient is
 	sfgrmin = 1e-7. The former limit 1e-5 was much too slack with



More information about the Vegan-commits mailing list