ggplot(data=Test, aes(x=Year, y=Value, color = Factor)) +
geom_point(size=2, shape=22) +
geom_smooth(method='lm') +
scale_y_continuous(breaks=c(1,50, 100, 150, 200, 250, 300, 365)) +
scale_x_continuous (breaks = Test$Year) +
theme(axis.text.x =
element_text(color = "grey20", size = 10, angle = 0,
hjust = .5, vjust = .5, face = "bold"),
axis.text.y =
element_text(color = "grey20", size = 10, angle = 0,
hjust = .5, vjust = .5, face = "bold"))
This is the code which I used to generate the attached graph having regression lines for two groups (FALL and Spring). As the data is huge (1910 rows), I am not pasting it here. I would like to generate 'y=mx+c' equation for both groups and annotate the graph with the same. May I know how can I proceed?