Giua 2 bien wt & mpg
library('car')
## Loading required package: carData
attach(mtcars)
scatterplot(wt~mpg | am, ylim=c(1,6), main='Scatterplot of wt by mpg', col=c('red','blue'), pch=c(16,8))
Giua 2 bien Sepal.Length & Sepal.Width, bien phan nhom = Species
attach(iris)
scatterplot(main='Scatterplot of Sepal.Length by Sepal.Width with factor = Species', Sepal.Length~Sepal.Width | Species)
library('ggplot2')
##
## Attaching package: 'ggplot2'
## The following object is masked from 'mtcars':
##
## mpg
z = ggplot(iris, aes(x=Sepal.Width, y=Sepal.Length))
z + geom_point(aes(col=Species)) + theme_bw() + theme(legend.position='bottom') + ggtitle('ggplot of Sepal.Length by Sepal.Width with factor Species')
THE END