This chapter showed us various ways of combining 2 tables by using the 2-table verbs of the dplyr package [R-dplyr]. Depending on the type of combination we wanted to achieve, we used various
join commands or set operations.
After working through this chapter, you should be able to use 2-table verbs of dplyr to:
- perform various mutating joins on 2 tables;
- perform various filtering joins on 2 tables;
- combine the cases of 2 tables with set operations; and
- know that
base::mergealso allows performing mutating joins.
The same procedure can be applied repeatedly to generalize beyond situations that only contain 2 tables. Take a look at Page 2 of the R Studio Cheat Sheet on Data transformation to check which commands you are now familiar with and which others you can still discover in the future:
Let’s test our knowledge and skills on joining tables by completing the following exercises.