This article includes animations of pivoting made by @grrrck and @datandme which are really helpful!
Also check out the RStudio Cloud primer on tidying data, which even has some exercises to help you learn more.

https://rstudio.cloud/learn/primers/4.1">https://rstudio.cloud/learn/pri...
case_when() helps you to create new variables depending on conditions in other variables. Think: make the fruit variable "Yes" if name_of_food is strawberry or apple.

@hrbrmstr has a nice article giving an overview of the benefits of case_when() https://rud.is/b/2017/03/10/making-a-case-for-case_when/">https://rud.is/b/2017/03...
If you prefer video, @sharon000 has a nice video overview of case_when() https://www.youtube.com/watch?v=amiW9H-oOS4">https://www.youtube.com/watch...
When you do anything with group_by() you can& #39;t forget to ungroup() afterwards.

Handy picture from @allison_horst to help us all remember!
This lesson from @kellybodwin will also help you write better functions.

https://cal-poly-advanced-r.github.io/STAT-431/Canvas_Pages/Week_4-Packages/Writing_Functions.html">https://cal-poly-advanced-r.github.io/STAT-431/...
When you& #39;re learning about merging data, the best place for visual learners to go is the {tidyexplain} package by @grrrck.

With animations like this, it makes it easy to make sense of the various joins in dplyr.
You can follow @rfortherest.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: