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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 22 11:19:33 CEST 2012


Author: jarioksa
Date: 2012-05-22 11:19:33 +0200 (Tue, 22 May 2012)
New Revision: 2172

Modified:
   pkg/vegan/R/monoMDS.R
   pkg/vegan/inst/ChangeLog
Log:
count only non-zero dissimilarities (= distinct points) for lower limit of sufficient data in monoMDS

Modified: pkg/vegan/R/monoMDS.R
===================================================================
--- pkg/vegan/R/monoMDS.R	2012-05-21 10:18:44 UTC (rev 2171)
+++ pkg/vegan/R/monoMDS.R	2012-05-22 09:19:33 UTC (rev 2172)
@@ -89,12 +89,12 @@
         iregn <- 3
         nobj <- nrow(mat)
     }
-    ## ndis: number dissimilarities
-    ndis <- length(dist)
+    ## ndis: number of >0 dissimilarities (distinct points)
+    ndis <- sum(dist > 0)
     ## some people try to use NMDS with too few points and too many
     ## dimensions
     if (ndis <= k * nobj)
-        stop(gettextf("Not enough data for NMDS: you have %d dissimilarities,\n  and you ask %d scores (%d dimensions times %d points)",
+        stop(gettextf("Not enough data: you have %d dissimilarities >0,\n  and you ask %d scores (%d dimensions times %d points)",
                       ndis, k * nobj, k, nobj))
     ## starting configuration
     if (missing(y)) {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-05-21 10:18:44 UTC (rev 2171)
+++ pkg/vegan/inst/ChangeLog	2012-05-22 09:19:33 UTC (rev 2172)
@@ -4,6 +4,9 @@
 
 Version 2.1-16 (opened May 11, 2012)
 
+	* monoMDS: Count only above-zero non-NA dissimilarities for the
+	absolute lower limit of sufficient data. 
+
 	* bioenv: accepts now dissimilarities or a square matrix that can
 	interpred as dissimilarities instead of a community data frame.
 	This allows using other dissimilarities than those in vegdist(). 



More information about the Vegan-commits mailing list