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”
你打的是legend("toprint",pch=1,
提示说了,应该是topright,属于打字出错