user1182741
user1182741

Reputation: 113

Error when performing an NMDS in R using package vegdist

I'm trying to perform an NMDS in R using the vegan package on a data set that has plots as columns and species counts as columns. My data is in the format of a text file (tab delimited) and contains a lot of '0' species counts. However, when I try to create a distance matrix I get the following error message:

bray <- vegdist(data1, method = "bray")                              

Warning messages: 1: In vegdist(data1, method = "bray") : you have empty rows: their dissimilarities may be meaningless in method “bray” 2: In vegdist(data1, method = "bray") : missing values in results

This prevents me from performing an NMDS:

nmds <- metaMDS(data1, k = 2, 
+           distance = 'bray', autotransform = FALSE)

Error in if (any(dist < -sqrt(.Machine$double.eps))) warning("some dissimilarities are negative -- is this intentional?") : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In distfun(comm, method = distance, ...) : you have empty rows: their dissimilarities may be meaningless in method “bray” 2: In distfun(comm, method = distance, ...) : missing values in results

How can I fix this?

Thank you for your answers!

Upvotes: 3

Views: 18636

Answers (2)

Vimukthi Gunasekara
Vimukthi Gunasekara

Reputation: 1

There is no way to make bray-curtis dissimilarity matrix withe zero communities. If you cannot remove the zero values use euclidean distance instead the bray

Upvotes: 0

user1182741
user1182741

Reputation: 113

Some columns contained only 0 counts. Removing these makes it work

Upvotes: 2

Related Questions