Back to: Introduction to R
Now that we have started to tidy up our data we can see that we have a need to transform this data. We may wish to add additional variables. Perhaps we also wish to only look at data that meets a certain requirement. The dplyr
package allows us to further work with our data.
dplyr
Functionality
With dplyr
we have five basic verbs that we will learn to work with:
filter()
select()
arrange()
mutate()
summarize()
We also will consider:
joins
group_by()
For the purposes of this example we will consider looking at the package nycflights13
. This is a dataset that has all flights in and out of NYC in 2013. We also will be using the dyplr
package from tidyverse
:
library(dplyr)
library(nycflights13)
On Your Own: RStudio Practice
Before moving onto the next portion. Take some time to consider the nycflights13 data. You can explore it with the following call:
library(nycflights12)
flights
Once you have spent some time looking at the data, move onto the next lesson.