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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 26 18:29:24 CEST 2011


Author: jarioksa
Date: 2011-08-26 18:29:24 +0200 (Fri, 26 Aug 2011)
New Revision: 1763

Modified:
   pkg/vegan/R/anosim.R
   pkg/vegan/inst/ChangeLog
Log:
anosim uses ranks so that it can handle negative dissimilarities (though these probably are a user error)

Modified: pkg/vegan/R/anosim.R
===================================================================
--- pkg/vegan/R/anosim.R	2011-08-26 15:40:29 UTC (rev 1762)
+++ pkg/vegan/R/anosim.R	2011-08-26 16:29:24 UTC (rev 1763)
@@ -1,4 +1,4 @@
-"anosim" <-
+`anosim` <-
     function (dat, grouping, permutations = 999,
               distance = "bray", strata) 
 {
@@ -11,7 +11,7 @@
     }
     else x <- vegdist(dat, method = distance)
     if (any(x < -sqrt(.Machine$double.eps)))
-        stop("dissimilarities must be non-negative")
+        warning("some dissimilarities are negative -- is this intentional?")
     sol <- c(call = match.call())
     grouping <- as.factor(grouping)
     matched <- function(irow, icol, grouping) {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-08-26 15:40:29 UTC (rev 1762)
+++ pkg/vegan/inst/ChangeLog	2011-08-26 16:29:24 UTC (rev 1763)
@@ -4,14 +4,18 @@
 
 Version 1.92-1 (opened August 23, 2011)
 
-	* adonis, anosim, betadisper, mrpp: check that dissimilarities are
+	* adonis, betadisper, mrpp: check that dissimilarities are
 	non-negative (small negative values are tolerated). The test was
 	not added to meandist: there may be legitimate usages for
 	correlation-like objects although summary.meandist() is
 	invalid. The addition was triggered by a user who tried to analyse
 	Chase et al. Raup-Crick values in the range -1 .. +1 in
-	betadisper(). 
+	betadisper().
 
+	* anosim: warn if some dissimilarities are negative. Function can
+	handle negative dissimilarities because it is based on ranks, but
+	probably this is a user error (but can be intentional and correct).
+
 	* specaccum, fitspecaccum: gained predict() methods. With
 	specaccum() predict(..., newdata) can estimate values for
 	'newdata' with linear or spline interpolation if necessary.



More information about the Vegan-commits mailing list