为了账号安全,请及时绑定邮箱和手机立即绑定

最后一步报错

hist(airquality$Wind,xlab="wind")

boxplot(airquality$Wind,xlab="wind",ylab="speed(mph)")

plot(airquality$Wind,airquality$Temp)

with(airquality,plot(Wind,Temp,main="Wind and Temp in NYC"))

title(main="Wind and Temp in NYC")


with(airquality,plot(Wind,Temp,

                     main="Wind and Temp in NYC",

                     type = "n"))

with(subset(airquality,Month==9),

     points(Wind,Temp,col = "red"))

with(subset(airquality,Month==5),

     points(Wind,Temp,col = "blue"))

with(subset(airquality,Month==8),

     points(Wind,Temp,col = "black"))


with(subset(airquality,Month %in% c(6,7,8)),

     points(Wind,Temp,col = "black"))

fit <- lm(Temp ~ Wind,airquality)

abline(fit,lwd=2)

legend("toprint",pch=1,

       col=c("red","blue","black"),

       legend=c("Sep","May","other"))


Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left",  : 

  'arg' should be one of “bottomright”, “bottom”, “bottomleft”, “left”, “topleft”, “top”, “topright”, “right”, “center”


正在回答

1 回答

你打的是legend("toprint",pch=1,

提示说了,应该是topright,属于打字出错

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
R语言之数据可视化
  • 参与学习       39107    人
  • 解答问题       137    个

R语言三大绘图系统,用图形直观探索数据、发现有价值信息

进入课程

最后一步报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信