The lattice
package has several "panel functions", one of which is panel.abline
.
Try this and see if it gives you what you're looking for:
xyplot(Neff ~ Eeff, data = phuong,
panel = function(x, y) {
panel.xyplot(x, y)
panel.abline(lm(y ~ x))
},
xlab = "Energy efficiency (%)",
ylab = "Nitrogen efficiency (%)")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…