Part 4: Wrangling data

Data wrangling is an umbrella term for many different ways in which data can be bent and twisted. As data usually must be aggregated and transformed to understand and make sense of it, we need a range of tools to select, combine, and reshape data structures. In R, these tools take the form of dedicated functions and packages.

This part currently contains three chapters:

  • Chapter 11 helps us getting data into R and a data structure in rectangular table format. This involves some familiarity with directory structures and file paths, and either importing data into R, or creating tabular data structures (e.g., data frames or tibbles) from other data structures or from scratch. All these topics can be addressed with base R (R Core Team, 2023b) functions or by the tidyverse (Wickham et al., 2019) packages here, readr, and tibble.

  • Chapter 12 introduces packages and tools for transforming data.

  • Chapter 13 combines all that we have learned so far into a set of principles and steps for exploring data.