r - How to avoid overlapping of labels in a NMDS plot? -
i tried avoid overlapping of labels in nmds plot using ggrepel
package. @ first code 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 received plot
so changed 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 got this
error: ggplot2 doesn't know how deal data of class character.
i love provide data make more easy answer question don't know how
Comments
Post a Comment