library(MASS)
data()
memisc
packagelibrary(memisc)
## Loading required package: lattice
##
## Attaching package: 'memisc'
## The following objects are masked from 'package:stats':
##
## contr.sum, contr.treatment, contrasts
## The following object is masked from 'package:base':
##
## as.array
women
The women dataset contains 15 rows of observations and 2 columns of variables which are “women.height” and “women.weight”.
x <- data.set(women)
x
##
## Data set with 15 observations and 2 variables
##
## women.height women.weight
## 1 58 115
## 2 59 117
## 3 60 120
## 4 61 123
## 5 62 126
## 6 63 129
## 7 64 132
## 8 65 135
## 9 66 139
## 10 67 142
## 11 68 146
## 12 69 150
## 13 70 154
## 14 71 159
## 15 72 164
typeof(x)
## [1] "list"
Able to retrieve statistical information such as min, max, mean, and standard deviation of height and weight.
codebook(x)
## ================================================================================
##
## women.height
##
## --------------------------------------------------------------------------------
##
## Storage mode: double
## Measurement: interval
##
## Min: 58.000
## Max: 72.000
## Mean: 65.000
## Std.Dev.: 4.320
##
## ================================================================================
##
## women.weight
##
## --------------------------------------------------------------------------------
##
## Storage mode: double
## Measurement: interval
##
## Min: 115.000
## Max: 164.000
## Mean: 136.733
## Std.Dev.: 14.973
Able to also retrieve statistical information in regards to measures on central tendency.
summary(x)
## women.height women.weight
## Min. :58.0 Min. :115.0
## 1st Qu.:61.5 1st Qu.:124.5
## Median :65.0 Median :135.0
## Mean :65.0 Mean :136.7
## 3rd Qu.:68.5 3rd Qu.:148.0
## Max. :72.0 Max. :164.0
x<-data.set(women)
class(women)
## [1] "data.frame"
sapply()
functionclass
function, the height and weight are in numeric
form.sapply(women, class)
## height weight
## "numeric" "numeric"
sapply(women, min)
## height weight
## 58 115
sapply(women,max)
## height weight
## 72 164
sapply(women,range)
## height weight
## [1,] 58 115
## [2,] 72 164
Able to also retrieve statistical information in regards to measures on central tendency.
summary(women)
## height weight
## Min. :58.0 Min. :115.0
## 1st Qu.:61.5 1st Qu.:124.5
## Median :65.0 Median :135.0
## Mean :65.0 Mean :136.7
## 3rd Qu.:68.5 3rd Qu.:148.0
## Max. :72.0 Max. :164.0