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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 12 16:50:22 CET 2012


Author: jarioksa
Date: 2012-12-12 16:50:22 +0100 (Wed, 12 Dec 2012)
New Revision: 2335

Modified:
   pkg/vegan/R/scores.metaMDS.R
   pkg/vegan/inst/ChangeLog
Log:
scores.metaMDS handles requests to non-existing scores

Modified: pkg/vegan/R/scores.metaMDS.R
===================================================================
--- pkg/vegan/R/scores.metaMDS.R	2012-12-12 15:46:07 UTC (rev 2334)
+++ pkg/vegan/R/scores.metaMDS.R	2012-12-12 15:50:22 UTC (rev 2335)
@@ -1,9 +1,11 @@
-"scores.metaMDS" <-
+`scores.metaMDS` <-
     function(x, display = c("sites", "species"), shrink = FALSE, choices, ...)
 {
     display <- match.arg(display)
     if (missing(choices))
         choices <- 1:x$ndim
+    else
+        choices <- choices[choices <= x$ndim]
     if (display == "sites")
         X <- x$points
     else if (display == "species") {
@@ -21,6 +23,6 @@
         }
     }
     colnames(X) <- paste("NMDS", 1:ncol(X), sep="")
-    X[, choices]
+    X[, choices, drop = FALSE]
 }
 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-12-12 15:46:07 UTC (rev 2334)
+++ pkg/vegan/inst/ChangeLog	2012-12-12 15:50:22 UTC (rev 2335)
@@ -4,8 +4,9 @@
 
 Version 2.1-22 (opened November 19, 2012)
 
-	* monoMDS: scores() ignores now requests to scores beyond those
-	calculated instead of failing.
+	* monoMDS, metaMDS: scores() ignore now requests to scores beyond
+	those calculated instead of failing. scores.metaMDS() does not
+	drop dimensions.
 
 	* nestednodf: added plot() method modelled after
 	plot.nestedtemp().



More information about the Vegan-commits mailing list