Add a regression equation and R² in ggplot2
In my early days as an analyst, adding regression line equations and R² to my plots in Microsoft Excel was a good way to make an impression on the management. Because maths. In R, it is a little harder to achieve. There are two main ways to achieve it: manually,…