I want to plot 3 different mean values (Mean1, Mean2 and Mean3) for 4 different species (A, B, C and D). I have 1 mean value per species and per years (2005, 2013 and 2022). Here is my R code (doesn't work):
ggplot(df, aes(x = interaction (Species, Year), y = c(Mean1, Mean2, Mean3, Mean4), fill = c(Mean1, Mean2, Mean3, Mean4)) + geom_bar(position = "stack", stat="identity")
I am trying to make the same type of barplot as shown on the picture on R but I don't manage to have all the mean (Mean1, Mean2, Mean3) on the same plot because they all come from a different column of my dataframe (see table on the image).
Is it possible to have more than one "fill" variable ? Or something else to obtain the same plot ?