2 Introductory Data Transformation with dplyr
This chapter covers
- learning the basics of assigning values to variables
- installing and loading packages from CRAN and GitHub
- accessing datasets and understanding the basic elements of a table
- using the dplyr filter() function, with expressions that filter a table to only the rows you need
- reordering rows with the dplyr arrange() function
- performing several column-selection operations with dplyr’s select() function
- creating new table columns (or modifying existing ones) with mutate() and carefully crafted expressions
- summarizing tabular data with the combination of group_by() and summarize()
We will start off by getting our bearings with assignment of variables in R. Later in the book, we’ll certainly get the opportunity to learn more programming fundamentals, however assignment is one of those topics that should be addressed right away. Then, the installation of packages will be covered. This will give us the chance to install the packages that are required for the book: tidyverse, edr, and devtools.
The rest of the chapter is devoted to learning a skill that is very important: transforming tabular data. Of all the skills you will learn in this book, the value of this one cannot be understated. A bit more than the usual amount of time will and should be spent on this.