R 会绘图但不会绘制 abline
> head(returnee)
[1] 1.3936536 -0.6730667 2.3584725 2.3477308 3.2841443 1.3168157
> head(vixee)
[1] 14.75 15.45 17.59 17.74 17.75 18.35
> class(returnee)
[1] "numeric"
> class(vixee)
[1] "numeric"
> plot(returnee, vixee)
> abline(lm(returnee ~ vixee))
当我运行它时,它给出了情节,但没有 abline。有什么建议吗?谢谢。
> head(returnee)
[1] 1.3936536 -0.6730667 2.3584725 2.3477308 3.2841443 1.3168157
> head(vixee)
[1] 14.75 15.45 17.59 17.74 17.75 18.35
> class(returnee)
[1] "numeric"
> class(vixee)
[1] "numeric"
> plot(returnee, vixee)
> abline(lm(returnee ~ vixee))
When I run this, it gives the plot, but there is no abline. Any suggestions? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它应该是 abline(lm(vixee ~ returnee)) 来匹配绘图的坐标。
It should be
abline(lm(vixee ~ returnee))
to match the coordinates of the plot.与@AK相反,我想说你的情节倒退了。一个或另一个......如果回归是你想要的方式(即
y~x
),那么尝试或者
In contrast to @AK, I was going to say you had your plot backwards. One or the other ... if the regression is the way you want it (i.e.
y~x
) then try eitheror