Plot quadratic regression with equation displayed
问题 I am trying to create a pdf page conatining 6 plots (3 rows and 2 columns) using a for loop. I am able to create the plots but i cant seem to automate adding a regression line to each plot. I am trying the following code. #Dummy data Data1 <- data.frame(flow = c(8,8.5,6,7.1,9), SP_elev = c(20,11,5,25,50)) Data2 <- data.frame(flow = c(7,7.2,6.5,8.2,8.5), SP_elev = c(13,15,18,25,19)) Data3 <- data.frame(flow = c(2,3,5,7,9), SP_elev = c(20,25,28,30,35)) Data4 <- data.frame(flow = c(1,4,6,8,9),