Chapter 8 Joining data
A serious limitation of our data wrangling experiences so far is that they only involved a single data table. In fact, this is rarely the case when we tackle realistic data science projects. Thus, in this chapter, we will start with 2 tables and learn combining them in various ways. This is still relatively simple, but can easily be generalized to multiple tables.
This chapter is still in the Data wrangling part of this book. The commands that we will use for joining 2 tables are implemented in the dplyr package (Wickham et al., 2020), which we already encountered as a core citizen of the tidyverse (Wickham, 2019c). In addition to the so-called 1-table verbs that we discussed in Chapter 3 on Data transformation, we will now learn additional 2-table verbs that allow combining the variables (columns) or cases (rows) of 2 tables