Part 18 Wrangle yo’ data with dplyr
18.1 Today’s Topics
Today we’ll get started with learning to “wrangle” data— that is, to subset it, rearrange it, transform it, summarize it, and otherwise make it ready for analysis. We are going to be working with the dplyr package. Specifically, we’re going to consider three lessons today:
Intro to dplyr syntax
The
|>
pipe and the dplyr advantagefilter
; relational/comparison and logical operators in RSpecific dplyr functions we will cover
select()
arrange()
filter()
mutate()
summarize()
group_by()
- grouped
mutate()
- grouped
summarize()
- grouped
recode()
across()
rowwise()
18.2 Resources
Here are some supplementary resources:
- A similar resource to the r4ds one above is the intro to dplyr vignette.
- Want to read more about piping? See r4ds: pipes.
Some advanced topics you might find useful:
- For window functions and how dplyr handles them, see the window-functions vignette for the dplyr package.
- For time series data, see the tsibble demo