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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 14 08:05:43 CET 2012


Author: jarioksa
Date: 2012-02-14 08:05:43 +0100 (Tue, 14 Feb 2012)
New Revision: 2089

Modified:
   pkg/vegan/R/scores.default.R
   pkg/vegan/inst/ChangeLog
Log:
scores.default failed if the user chose non-existing axes

Modified: pkg/vegan/R/scores.default.R
===================================================================
--- pkg/vegan/R/scores.default.R	2012-02-13 12:45:06 UTC (rev 2088)
+++ pkg/vegan/R/scores.default.R	2012-02-14 07:05:43 UTC (rev 2089)
@@ -51,8 +51,10 @@
     }
     if (is.null(colnames(X))) 
         colnames(X) <- paste("Dim", 1:ncol(X), sep = "")
-    if (!missing(choices)) 
+    if (!missing(choices)) {
+        choices <- choices[choices <= ncol(X)]
         X <- X[, choices, drop = FALSE]
+    }
     X <- as.matrix(X)
     X
 }

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-02-13 12:45:06 UTC (rev 2088)
+++ pkg/vegan/inst/ChangeLog	2012-02-14 07:05:43 UTC (rev 2089)
@@ -3,7 +3,12 @@
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
 Version 2.1-12 (opened February 9, 2012)
-	
+
+	* scores.default: failed if users asked scores of non-existing
+	axes. This was reported as an error in ordiplot() when the user
+	tried to plot 2-dim graph of 1-dim solution in
+	https://stat.ethz.ch/pipermail/r-sig-ecology/2012-February/002764.html
+
 	* simper: new function to implement "similarity percentages" of
 	Clarke (Austral. J. Ecol. 18, 117-143; 1993) contributed by Eduard
 	Szöcz (Uni Landau, Germany).



More information about the Vegan-commits mailing list