Week 5
Tidying and joining spatial data
weeks
Summary
This week we are learning to use {dplyr}
and {tidyr}
to join tables and switching data between a wide and long format.
Overview
Key Objectives
- Practice joining tables by attribute with
{dplyr}
- Practice converting between wide and long data formats with
dplyr::pivot_longer()
anddplyr::pivot_wider()
- Practice recoding categorical attribute data using the {forcats} package
Prepare
Required readings
- Ch. 6 Data tidying in Hadley Wickham, Garrett Grolemund, and Mine Çetinkaya-Rundel R for Data Science: Import, Tidy, Transform, Visualize, and Model Data, 2nd edition. (Sebastopol, CA: O’Reilly Media, 2023), https://r4ds.hadley.nz/.
- Ch. 14 Data cleaning in Crystal Lewis Data Management in Large-Scale Education Research, 1st ed. (Chapman & Hall, 2024), https://datamgmtinedresearch.com/.
- Ch. 1 Local Origins, Ch. 2 A Place for Plant Data, and Ch. 3 Collecting Infrastructures in Yanni Alexander Loukissas All Data Are Local: Thinking Critically in a Data-Driven Society, 2019, doi:10.7551/mitpress/11543.001.0001.
Optional readings
- Catherine D’Ignazio and Lauren Klein “Who Collects the Data? A Tale of Three Maps,” MIT Case Studies in Social and Ethical Responsibilities of Computing (February 5, 2021), doi:10.21428/2c646de5.fc6a97cc.
- Karl W. Broman and Kara H. Woo “Data Organization in Spreadsheets,” The American Statistician 72, no. 1 (January 2, 2018): 2–10, doi:10.1080/00031305.2017.1375989.
Participate
Practice
Exercise details to be provided.