I am trying to make a basic scatterplot that displays the regression equation and r2 values in the top left of the plot panel. Below is the code to generate an initial figure with just the r2 value.
plot(OverlapInner$PR1Max, OverlapInner$PR4Max, ylim = c(23, 29), xlim = c(23, 29))
abline(a = 0, b = 1)
fit <- lm(PR1Max ~ PR4Max, data = OverlapInner)
legend("topleft", bty = "n", legend = paste("R2:",format(summary(fit)$adj.r.squared,
digits=4)))