[R-sig-eco] Problems with vegdist in Vegan

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Dec 1 21:06:03 CET 2008


On Mon, 2008-12-01 at 19:30 +0000, Gavin Simpson wrote:
> I don't understand your data? Dissimilarities are computed with
> vegdist() in vegan on an n x m matrix of n samples and m variables. The
> m variables could be species or any other set of descriptor variables.
> 
> Is your data like this? Or did you mean that your data are n samples
> with a single column of numbers representing the count of a single thing
> at each of the n samples? If so, are some counts zero? This doesn't
> sound like a community matrix as I describe above to me.
> 
> I think the error message is reasonably clear; You have some samples
> (rows) with no positive values in them (i.e. some all-zero counts for a
> given sample (row)). In such cases, the Jaccard distance is not defined
> - the warning is coming from the Bray-Curtis routine [as these two
> dissimilarities are equivalent] and hence the ambiguity there ("...may
> be..."), as the connoisseur may know what they are doing and know what
> to do with such results.

[sorry should have checked rather than rely on my memory; never a good
thing after a 5am start...]

The warning is actually coming from your use of 'dist = "jaccard"'.
There is no argument 'dist' in vegdist() hence the default 'method =
"bray"' is used, and hence the warning is raised from the initial checks
in vegdist()

Where I was misremembering is that it is in the C source that the bray
routine *is* used even if you want/ask for Jaccard. vegdist() sorts out
the difference to be the Bray-Curtis distances into Jaccard ones.

That said - the problem with your data still remains if you set method =
"jaccard".

G

> 
> The second message is a consequence of the first; as the Jaccard is not
> defined for empty rows, you get NA values for those comparisons
> concerning this/those sample(s).
> 
> So I think yes, it is a problem and you need to consider how to proceed.
> Perhaps taking a look at rowSums(yourData) might indicate which samples
> are causing the problem.
> 
> HTH
> 
> G
> 
> On Thu, 2008-11-27 at 16:40 -0600, Manuel Spínola wrote:
> > Dear list members,
> > 
> > I am runnig a NMDS in Vegan (version 1.13.2, Windows) and I get the 
> > following message with the function vegdist:
> > 
> >  > aves.dis <- vegdist(avesp.esp, dist="jaccard")
> > Warning messages:
> > 1: In vegdist(avesp.esp, dist = "jaccard") :
> >   you have empty rows: their dissimilarities may be meaningless in 
> > method bray
> > 
> > 2: In vegdist(avesp.esp, dist = "jaccard") : missing values in results
> > 
> > I have sites (point counts) without species, is it a problem?
> > Thank you very much in advance.
> > Best,
> > 
> > Manuel Spínola
> >
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list