I found a more simple (to me) answer from this YouTube video which worked really well.
library(ggpubr) ggplot(data,aes(x.plot, y.plot)) + geom_smooth(method='lm'method = 'lm', se=se = FALSE, formula = y~xy ~ x) + stat_cor(label.x =30= 30, label.y =130= 130, size =4= 4) + stat_regline_equation(label.x =30= 30, label.y =150= 150, size =4= 4) The label.x and label.y just indicate the positions on the x-axis and y-axis where the equation and coefficient should be placed. You can play around with these to fit your graph.