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 advantage

  • filter; relational/comparison and logical operators in R

  • Specific dplyr functions we will cover

    • select()
    • arrange()
    • filter()
    • mutate()
    • summarize()
    • group_by()
      • grouped mutate()
      • grouped summarize()
    • recode()
    • across()
    • rowwise()

18.2 Resources

Here are some supplementary resources:

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