How to avoid overlapping of labels in a NMDS plot?

3.2k views Asked by At

I tried to avoid overlapping of labels in a NMDS plot by using the ggrepel package. At first my code was like this:

result <- adonis(spiders~Wald, data = env, permutations=1000)
result1 <- metaMDS(spiders, distance = "bray", k = 2)
fit <- envfit(result1, env, perm = 1000)

fig<-plot(result1, type = "none")
points(fig, "sites", pch = as.numeric(env$Wald))
text(fig, "species", font=c(2), cex=c(0.75))
plot(fit, p.max = 0.05, col = "darkgrey", font=c(2), cex=c(0.75))
legend("topright", legend = c("Bestand A", "Bestand B", "Bestand C"),cex = 
c(0.75), pch = as.numeric(env$Wald))

And I received this plot

NMDS-plot

so I changed my code slightly

fig<-plot(result1, type = "none")
points(fig, "sites", pch = as.numeric(env$Wald))
geom_text_repel(fig, "species", font=c(2), cex=c(0.75))
plot(fit, p.max = 0.05, col = "darkgrey", font=c(2), cex=c(0.75))

but than I got this

Error: ggplot2 doesn't know how to deal with data of class character.

I would love to provide my data to make it more easy to answer my question but I don't know how

0

There are 0 answers