I'm new to R.
I have produced the following plot but want to know how to include an R^2 value on the linear model line using ggpmisc and the stat_poly_eq
function. The code I have is as follows -
ggplot(xray, aes(x=PercentGoodFish1g, y=PercentPopAff)) +
geom_smooth(method='lm') +
geom_point()
Can somebody help with this? I have visited links with examples but can't make sense of the code and what it is doing in order to apply it to my plot.
Thanks