I'm trying to make a CCA plot of some environmental and macrofaunal data. My code looks like this:
library(dplyr)
library(vegan)
library(ggvegan)
all_abun <- abundance
env_PLI <- environment
env_vectors <- env_PLI[, c(1, 3:14)]
abun_GEMAX <- all_abun %>% filter(method == "GEMAX") %>% select(-`Limapontia spp.`)
abun_df <- abun_GEMAX[, 7:29]
site_CCA <- cca(abun_df ~ NH4_inv_PW + C_1cm + PLI + season_year, data = env_PLI)
autoplot(site_CCA)
Now, the variable season_year has two levels, "autumn 2016" and "summer 2017". For some reason the CCA feels obliged to add those into the resulting graph, even though it doesn't do the same thing to any other variable.
How do I stop it from doing that, so I can just have a graph that says "season_year" without "autumn 2016" and "summer 2017" sitting there as well?
If you have factor constraints, they are displayed in the graph. You have defined season_year
as a factor, and its levels are displayed in the graph. The other constraints are continuous vector constraints and they are displayed as arrows. To have season_year
as a continuous variable displayed as an arrow, you must define season_year
as a continuous variable.