I am trying to make quadratic regression line of my plot but, in my graph, I found too many line sticked together. I want a single line and not too many. Can anyone help me?
Thanks, my code is as follows data1 <- read.csv("C:/Users/Tej Prasad Acharya/Documents/NUE/NDVI and SPAD.csv") attach(data1)
withrow <- data1[which(data1$Rowcover == "Yes"),]
withoutrow <- data1[which(data1$Rowcover == "No"),]
withrow <- data1[which(data1$Rowcover == "Yes"),]
withoutrow <- data1[which(data1$Rowcover == "No"),]
plot(withrow$SPAD..60.DAT. ~ withrow$N.rate)
m2 <- lm(withrow$SPAD..60.DAT. ~ withrow$N.rate + I(withrow$N.rate^2))
lines(withrow$N.rate,predict(m2))