O Cranemountain
O Cranemountain

Reputation: 1

NMDS in vegan package

I struck with some problem trying to get NMDS-plot to work in Vegan package. I get this message:

Error in stressplot.default(df) : can be used only with objects that are compatible with MASS::isoMDS results

The result looks very strange to me; what might cause this problem?

result from plot

library(vegan)

df <- matrix(c(0, 1, 0, 148, 190, 134, 186, 17, 9, 0, 9, 0, 0, 0, 1, 34, 115, 41, 9, 1, 1, 2, 0, 1,1, 0, 0, 29, 73, 18, 4, 3, 1, 0, 2, 0),ncol=12,byrow=TRUE)
colnames(df) <- c("sp1", "sp2", "sp3", "sp4", "sp5", "sp6", "sp7", "sp8", "sp9", "sp10", "sp11", "sp12")
rownames(df) <- c("site1","site2","site3")
df_NMDS <- metaMDS(df, distance = "bray", autotransform = FALSE)
plot(df)
stressplot(df)

Upvotes: 0

Views: 502

Answers (1)

Vitor Xavier de Lima
Vitor Xavier de Lima

Reputation: 31

You're actually trying to plot yout dataframe. Instead you should plot the metaMDS result.

plot(df_NMDS)
stressplot(df_NMDS)

Upvotes: 1

Related Questions