我正在寻找吃冰淇淋和玩游戏之间的关系。
我的代码:
sizedata = read.table(file.choose(), header= T, sep =',')
View(sizedata)
summary(sizedata)
lm(Icecream ~ Games, sizedata)
library(ggplot2)
ggplot(sizedata, aes(x=Icecream, y=Games)) + geom_point() + ylim(0,1000) +
stat_smooth(method='lm')
ggplot(sizedata, aes(x=Icecream, y=Games)) + geom_point() + ylim(0,1000) +
geom_smooth()
图形显示如下:
答案 0 :(得分:0)
@Russ Hyde和@camille指出-您的ylim
参数太高。尝试将其更改为较低的值,例如ylim(0,100)
或ylim(0,50)
。