I am trying to perform an anosim analysis in Vegan, but it doesn't seem to work... It doesn't give an error after the anosim function, but when I try to see the summary it says:
Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
'x' must be atomic
My data looks like a simple community matrix with sites and species (identical to the Dune data set).
I've tried this:
dist.com <- vegdist(data, method = "bray")
an = anosim(dist.com, env)
summary(an)
The class of data
is a data.frame , the class of env
is factor and the class of dist.com
is dist.
It is identical to the example in help...
How can I fix this problem?
There is nothing reproducible here, but I can generate this error message if the factor has only one level:
summary(anosim(vegdist(dune), rep("a", nrow(dune))))
来源:https://stackoverflow.com/questions/28701743/anosim-in-vegan-is-not-working