Skip to content
Prev 325869 / 398503 Next

Error with metaMDS

On Mon, 2013-06-24 at 19:33 +0800, Suparna Mitra wrote:
<snip />
That is fundamentally wrong - you are setting argument `X` to the
character vector `"bray"`, that is not how you call metaMDS(). Hence I
suspect you didn't bother to include the full code...!

Let's assume you cal actually call metaMDS() correctly...

The first set of warnings (not the error) come `vegdist()`. The first is
from :

if (method > 2 && any(rowSums(x, na.rm = TRUE) == 0))

and hence if you do

which(rowSums(X, na.rm = TRUE) == 0)

you'll see which rows (samples) have no counts at all. The second
warning in the first set comes from

if (any(is.na(d))) 
        warning("missing values in results")

hence by the time vegdist has computed the dissimilarity, those
computation ended up generating one or more `NA` values. Things go
downhill from there as the error generated from within metaMDS() is
because we are comparing the distances with the smallest representable
number and any comparison with `NA` yields `NA` and hence the first
Error you see. We should probably catch that but I don't have a
reproducible example to see why we don't...
Look at `str(data)` and if any of the columns are factors, change them
to be numeric or find out why R thinks they are factors - it wouldn't
normally convert numeric data to a factor when reading the data in.

What is `data`? You only refer to `Genus_data`.

Please try to be specific about exactly what you did - i.e. include the
actual code.

I suspect the things you try below are pointless as it is not zero
distances that are the problem but sites for which no observations were
recorded.

G