Types of visual displays to be covered

Data sets used

Structure of data sets

## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 189 obs. of  6 variables:
##  $ low                         : chr  "less_than_2.5_kg" "less_than_2.5_kg" "less_than_2.5_kg" "less_than_2.5_kg" ...
##  $ age                         : num  20 21 18 22 29 26 18 18 25 28 ...
##  $ race                        : chr  "one" "one" "one" "one" ...
##  $ smoke_during_preg_1_yes     : num  1 1 1 0 1 1 1 1 1 1 ...
##  $ ht_history_hypetension_1_yes: num  0 0 0 0 0 0 0 0 0 0 ...
##  $ bwt_kg                      : num  2557 2594 2600 2637 2663 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   low = col_character(),
##   ..   age = col_double(),
##   ..   race = col_character(),
##   ..   smoke_during_preg_1_yes = col_double(),
##   ..   ht_history_hypetension_1_yes = col_double(),
##   ..   bwt_kg = col_double()
##   .. )
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 2000 obs. of  8 variables:
##  $ AGE     : num  30 56 55 47 50 45 25 61 50 19 ...
##  $ GENDER  : num  0 0 0 1 1 1 0 1 0 1 ...
##  $ EXPENDIP: num  0 0 16121 0 0 ...
##  $ EXPENDOP: num  0 2385 29730 110 3299 ...
##  $ RACE    : chr  "WHITE" "BLACK" "WHITE" "BLACK" ...
##  $ REGION  : chr  "MIDWEST" "SOUTH" "MIDWEST" "NORTHEAST" ...
##  $ EDUC    : chr  "LHIGHSC" "HIGHSCH" "COLLEGE" "COLLEGE" ...
##  $ MARISTAT: chr  "MARRIED" "MARRIED" "MARRIED" "MARRIED" ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   AGE = col_double(),
##   ..   GENDER = col_double(),
##   ..   EXPENDIP = col_double(),
##   ..   EXPENDOP = col_double(),
##   ..   RACE = col_character(),
##   ..   REGION = col_character(),
##   ..   EDUC = col_character(),
##   ..   MARISTAT = col_character()
##   .. )

Bar graph (Two categorical Variable)

## Warning in spineplot.default(x, y, ...): y axis is on a cumulative probability
## scale, 'ylim' must be in [0,1]

## Warning in spineplot.default(x, y, ...): y axis is on a cumulative probability
## scale, 'ylim' must be in [0,1]

Historam

Boxplot (Single numerical variable)

Boxplot (Single numerical variable by group)

Useful resources

  1. Quick-R
  2. A Comprehensive Guide to Data Visualisation in R for Beginners