Skip to content

Commit ff78d5f

Browse files
committed
vegdist: warn on using Morisita with 0/1 data, see issue #444
1 parent 9ed7edb commit ff78d5f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

R/vegdist.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
if (method %in% c(7, 13, 15) && !isTRUE(all.equal(x, round(x))))
5656
warning("results may be meaningless with non-integer data in method ",
5757
dQuote(inm))
58+
if (method %in% 7 && round(max(x)) == 1) # morisita
59+
warning("results may be meaningless with largest integer 1 in method ",
60+
dQuote(inm))
5861
d <- .Call(do_vegdist, x, as.integer(method), PACKAGE = "vegan")
5962
d[d < ZAP] <- 0
6063
if (any(is.na(d)))

man/vegdist.Rd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@
226226
in the species present at site \eqn{j} that occur with only one
227227
individual in site \eqn{k} (Chao et al. 2005).
228228
229-
Morisita index can be used with genuine count data (integers) only. Its
229+
Morisita index can be used with genuine count data (integers) only. It
230+
is based on the idea of resampling without replacement and should not
231+
be used with presence/absence data, but may give meaningless results
232+
if compared sampling units (rows) have largest integer 1. Its
230233
Horn--Morisita variant is able to handle any abundance data.
231234
232235
Mahalanobis distances are Euclidean distances of a matrix where

0 commit comments

Comments
 (0)