Chapter 2 Handling Data

This Chapter will discuss some basic details of handling data. We will go over different types of data representations, and how to go between them using R (especially using the tidyverse set of packages).

The learning objectives for this chapter are:

  • Readers should be able to distinguish what is wide-form data and what is long-form data.
  • Readers should be able to convert wide-form data to long-form, and vice versa (e.g., using tidyverse).
# Load the libraries we'll use in this chapter
library(pander) # for displaying tables

library(tidyverse) # for data munging
## tidyverse encompasses both tidyr and dplyr, as well as ggplot2 and many others
##  library(tidyverse) is equivalent to:
# library(tidyr)
# library(dplyr)
# library(ggplot2)