Hello World! I, Aniq Kaw (Nick) would like to demonstrate on some of the basic features in regards to Codebook.
Let’s explore, shall we?

Creating the codebook using standard R API functionality

To view all available dataset in R
library(MASS)
data()
Load the memisc package
library(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
Import dataset on 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
To check data type of dataset elements
typeof(x)
## [1] "list"
To call the codebook function

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
To provide summary of dataset

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

Manually creating a custom codebook

To check data type of dataset structure
x<-data.set(women)
class(women)
## [1] "data.frame"
Utilize the sapply() function
  • The function takes the list, vector or data frame as input and outputs in a form of vector or matrix.
  • Based on class function, the height and weight are in numeric form.
sapply(women, class)
##    height    weight 
## "numeric" "numeric"
To provide minimum value for all variables
sapply(women, min)
## height weight 
##     58    115
To provide maximum value for all variables
sapply(women,max)
## height weight 
##     72    164
To provide minimum and maximum value for all variables
sapply(women,range)
##      height weight
## [1,]     58    115
## [2,]     72    164
To provide summary of dataset

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
Thank you and please visit again some time soon! =)

Signing off

-Aniq Kaw (Nick)-