I am trying to recreate this plot:
I have data on actual habitat presence and random data on expected habitat presence for 8 years. I want to see if the presence of bird species depends on the presence of certain crop types.
The code for the plot looks like this:
ggplot() +
geom_boxplot (data = random_soort2, aes(x=categorie, y=fractie, fill=type)) +
theme_classic() +
scale_fill_grey() +
geom_point (data = sum_echt, aes(x=categorie, y = mean, fill=type),colour="red")
And creates the following plot:
The problem is that the red dots of the actual data are not separated by type, but are all grouped together. How do I separate them based on type?