phan tich do thi
du lieu trong dataframe mtcars
#doc du lieu vao
data("mtcars")
h = head(mtcars)
summary(h)
## mpg cyl disp hp drat
## Min. :18.10 Min. :4 Min. :108.0 Min. : 93.0 Min. :2.760
## 1st Qu.:19.27 1st Qu.:6 1st Qu.:160.0 1st Qu.:106.2 1st Qu.:3.098
## Median :21.00 Median :6 Median :192.5 Median :110.0 Median :3.500
## Mean :20.50 Mean :6 Mean :211.8 Mean :117.2 Mean :3.440
## 3rd Qu.:21.30 3rd Qu.:6 3rd Qu.:249.8 3rd Qu.:110.0 3rd Qu.:3.888
## Max. :22.80 Max. :8 Max. :360.0 Max. :175.0 Max. :3.900
## wt qsec vs am gear
## Min. :2.320 Min. :16.46 Min. :0.0 Min. :0.0 Min. :3.0
## 1st Qu.:2.684 1st Qu.:17.02 1st Qu.:0.0 1st Qu.:0.0 1st Qu.:3.0
## Median :3.045 Median :17.82 Median :0.5 Median :0.5 Median :3.5
## Mean :2.988 Mean :18.13 Mean :0.5 Mean :0.5 Mean :3.5
## 3rd Qu.:3.384 3rd Qu.:19.23 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:4.0
## Max. :3.460 Max. :20.22 Max. :1.0 Max. :1.0 Max. :4.0
## carb
## Min. :1.000
## 1st Qu.:1.000
## Median :1.500
## Mean :2.167
## 3rd Qu.:3.500
## Max. :4.000
# ve histogram cho bien disp
attach(mtcars)
hist(disp,main = 'so dem xe theo disp',col = 'blue',border = 'red')

tom lai
the mean is: 230.721875
the median is: 196.3.
hist cho wt
hist(wt,main = 'so dem theo trong luong')

## don gian the thoi ....