我尝试通过图形创建一条拟合线,但它根本没有显示,它只显示图形本身。我在这做错了什么?检查下面的代码。
cor.merged <- cor.merged[order(cor.merged$No.florets), ]
plot(vis.rate ~ No.florets, data = cor.merged[cor.merged$line == 'M',],
main = "Nectar production vs visitation rate",
xlab = "No.florets", ylab = "Visitation rate",
pch = 19)
m1 <- lm(cor.merged$vis.rate[cor.merged$line == 'M'] ~
poly(cor.merged$No.florets[cor.merged$line == 'M'], 2, raw = T))
summary(m1)
lines(cor.merged$No.florets[cor.merged$line == 'M'] ~
predict(m1),
col = 'red', lwd = 3, type = 'c')