Lecture 5

Importing, Exporting, and Cleaning Data

October 28, 2025


Slides & Code

HTML slides • Raw qmd file • R Code


Data

Billboard Top 100 (2000) • Religion & Income


Suggested Reading (from R for Data Science (2e)1)

Chapter 8: Data import • Chapter 6: Data tidying • Chapter 17: Factors •
Chapter 28: Dates and Times


1 Hadley Wickham, Mine Çetinkaya-Rundel & Garrett Grolemund

Useful Resources

Cheatsheets

tidyr • readr • SAS --> R • Stata to R • forcats • lubridate

Package Websites

tidyr • readr • haven • readxl • googlesheets4 • googledrive •
forcats • lubridate

Crowdsource Help

CS&SS 508 Slack Workspace • Posit community • Stackoverflow