在r中的基本图形中绘制多个拟合线

时间:2016-09-01 13:23:12

标签: r plot

我试图在唯一的情节中绘制多条合适的lm线:

margin-top: 2.5%;

然后我通过ggplot立即绘制所有拟合:

library(lme4)
fits <- lmList(Sepal.Length ~ Petal.Width | Species, data=iris)
coefs <- data.frame(coef(fits)); names(coefs) = c("Int", "slopes")

有人可以帮助我以基本图形方式进行吗?

enter image description here

1 个答案:

答案 0 :(得分:4)

plot(Sepal.Length ~ Petal.Width, data = iris)
lapply(fits, abline)

enter image description here