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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 28 21:23:42 CEST 2011


Author: jarioksa
Date: 2011-08-28 21:23:40 +0200 (Sun, 28 Aug 2011)
New Revision: 1770

Modified:
   pkg/vegan/R/meandist.R
   pkg/vegan/inst/ChangeLog
Log:
warn on negative dissimilarities in meandist

Modified: pkg/vegan/R/meandist.R
===================================================================
--- pkg/vegan/R/meandist.R	2011-08-28 19:17:11 UTC (rev 1769)
+++ pkg/vegan/R/meandist.R	2011-08-28 19:23:40 UTC (rev 1770)
@@ -1,6 +1,9 @@
 `meandist` <-
     function(dist, grouping, ...)
 {
+    ## check that 'dist' are dissimilarities (non-negative)
+    if (any(x < -sqrt(.Machine$double.eps)))
+        warning("some dissimilarities are negative -- is this intentional?")
     ## merge levels so that lower is always first (filling lower triangle)
     mergenames <- function(X, Y, ...) {
         xy <- cbind(X, Y)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-08-28 19:17:11 UTC (rev 1769)
+++ pkg/vegan/inst/ChangeLog	2011-08-28 19:23:40 UTC (rev 1770)
@@ -9,6 +9,9 @@
 
 	* MDSrotate: metaMDSrotate() was renamed to MDSrotate(), and
 	metaMDSrotate() was .Deprecated. 
+
+	* meandist: warns if some dissimilarities are negative (small
+	negative values are tolerated).
 	
 Version 1.92-1 (closed August 28, 2011)
 



More information about the Vegan-commits mailing list