This chapter introduced basic ways of data transformation using the tools provided by the dplyr package.
After working through this chapter, you should be able to use dplyr to:
- arrange cases (rows) based on one or more criteria;
- select cases (rows) and variables (columns) from a data table;
- change and create new variables;
- compute summary statistics over variables and grouped values;
- combine multiple commands into pipes to answer questions and create new data tables.
This chapter only covered some essential tools provided by the dplyr package. Take a look at the Posit cheatsheets on data transformation to check which commands you are now familiar with and which others you can still discover in the future:
We will encounter more types of data transformation in Chapter 7 on Tidying data and additional dplyr functions in Chapter 8 on Joining data.
Let’s test our knowledge and skills by completing the following exercises.