我正在尝试制作我的情节的二次回归线,但在我的图表中,我发现太多的线条粘在一起。我想要一条线而不是太多。任何人都可以帮助我吗?
谢谢,我的代码如下 data1< - read.csv(" C:/ Users / Tej Prasad Acharya / Documents / NUE / NDVI and SPAD.csv&#34) 附(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))