So I am graphing some data and getting a smoothed curve using geom_smooth. How can I display the equation that geom_smooth uses on the graph - I have found solutions for linear data but not for sinusoidal data - and perhaps also the r^2 value.
ggplot(all_year_month_eng_wth,aes(x = year_month, y=energy_sum_mean,colour="Energy Cons.",group=1)) +
geom_line()+
geom_point()+
geom_smooth(method="lm", formula=y~cos(2*pi*x/12) + sin(2*pi*x/12)) +
theme(legend.position = c(0.8,0.9),axis.text.x = element_text(angle = 90,hjust = 1))