Boxplot - how to rotate x-axis labels to 45°?

I have never used the vegan package. Looking at the documentation, you might be able to make a data frame with

DF <- data.frame(group = disprt$group, distances = disprt$distances)

and then use DF in place of disprt in ggplot().

It is possible to rotate the labels in the boxplot() fucntion. I got this code from https://stats.idre.ucla.edu/r/faq/how-can-i-change-the-angle-of-the-value-labels-on-my-axes/

boxplot(distances ~ group, data = disprt, pars  =  list(xaxt = "n"))
axis(1, at=c(1,2), labels = FALSE)
text(c(1,2), par("usr")[3] - 1, labels = disprt$group, srt = 45, pos = 1, xpd = TRUE)
1 Like