Week 7: tidyr
Lectures
Labs
- Lab 7: Tidying Data(PDF)
- Lab 7 solutions (password)
Additional readings
- tidyr cheat sheet (Posit)
- R for Data Science: Tidy data
- tidyr: Pivoting
- What They Forgot to Teach You About R: Safe paths
- A tidyverse pivot approach to data preparation
Discussion
- Is a table tidy if each country is one row and 2020, 2021, and 2022 are column names? Why or why not?
- When would
pivot_wider()after a summary help, and when would it make the next ggplot harder?