绘图语句
1.单变量散点图
plot(women$height)
plot(mtcars$cyl)
2.多变量散点图
plot(women$height,women$weight)
3.单变量直方图
plot(as.factor(women$height))
plot(as.factor(mtcars$cyl))
4.多变量直方图
plot(as.factor(mtcars$cyl),mtcars$carb)
5.多维度直方图
plot(as.factor(mtcars$carb),as.factor(mtcars$cyl))
6.变量线性回归图
plot(women$height~ women$weight)
fit <- lm(height~weight,data=women)
plot(fit)