I'm having trouble with this one here. I'm trying to add labels to my CCA plot, only for the species category. Normally I would include that in the aes function, however, ggplot2 isn't capable to creating cca plots, so I had to use the vegan package to create the plot, ggvegan to convert it to an object recognizable by ggplot, and then edit it as an object from there.
cca <- cca(sp_matrix~average+bpi_st_fi+northing+easting+slope+depth,
data=mollusca)
plot(cca)
summary(cca)
ccaplot <- autoplot(cca)
ccaplot +
lims(x = c(-2.5, 2.5)) + lims(y = c(-2.5,2.5)) +
theme(panel.background = element_blank()) + geom_hline(aes(yintercept=0),
colour="#8c8c8c") +
geom_vline(aes(xintercept=0), colour="#8c8c8c")
This is the resulting CCA plot that is generated
When I create the original plot using "vegan", it labels the species, but when I convert it to a ggplot object it deletes them. Will I have to edit the plot using base R code, or is there a way to both get the species labels back and edit their size, font and colour with ggplot2?
fortify(cca, display = "sp")
to get just the species scores and then give this data.frame togeom_label
– Richard Telford