I've been searching for a while now about how to customize the autoplot()
function to project an RDA object with R. This function is coming with the possibility to code in ggplot()
grammar. My problem is that everywhere I go on the web there is always a code in the first parenthesis that seems to overwhelm everything that follows.
First example, I want to show my species in front of my sites (something not made by default here). I use the "order = species-sites" to do it as well, but when I run the code my figure is sorted as if this new line doesn't exist. There is no error or warning in the code for this.
autoplot(dune.rda,
arrows = FALSE,
geom = "text",
legend = "none",
scaling = "symmetric",
layers = c("species", "sites", "biplot"),
order = "species-sites-biplot") +
geom_abline(intercept = 0, slope = 0, linetype = "dashed", size = 0.8) +
geom_vline(aes(xintercept = 0), linetype= "dashed", size = 0.8) +
labs(x = "Axis 1 (13.8%)", y = "Axis 2 (2.9%)") +
theme_classic()
Second example, I want to change the color and the size of the species layer. I write as I would do in ggplot()
format. Again, it changes nothing to drop or add the geom_text line argument.
dune.rda <- rda(dune, dune.env)
autoplot(dune.rda, arrows = FALSE, scaling = "symmetric", ) +
geom_text(aes(colour = "Species"), size = 3, colour = "red") +
theme_classic()
There is a lack of information about the ggfortify
package for RDA. In theggfortify
resource document, I can't even see autoplot.rda section. Is there a place to learn more about how to use this package?