I can't seem the geom_smooth function to work. I have tried the method = 'loess' and function = 'y ~ x' but I have several y-values and one x-value (which is a factor) which is the date.
This is the code that I have right now. Does any of you have som tips?
ggplot(allmortality, aes(Date)) +
geom_point(aes(y=C28), color = "firebrick") +
geom_point(aes(y=G1), color="red") +
geom_point(aes(y=G2), color = "darkgreen") +
geom_point(aes(y=G3), color = "blue") +
geom_point(aes(y=A), color = "orange") +
theme(axis.text.x = element_text(angle = 50, vjust = 1, hjust = 1)) +
theme(axis.title.x = element_text(vjust = 0, size = 12, face = "bold"),
axis.title.y = element_text(vjust = 2, size = 12, face = "bold")) +
theme(plot.caption = element_text(hjust = 0)) +
theme(panel.grid = element_blank())