Data Transformation II

Week 10, Fall 2024

Summary

This week we will continue our discussion of the tidyverse. In particular, we’ll discussion data import and export, tidying data, and joining data.

Learning Objectives

After completing this week, you are expected to be able to:

  • Identify “tidy” data.
  • Transform untidy data to tidy data using tidyr, in particular:
    • pivot_wider to transform long data to wide data
    • pivot_longer to transform wide data to long data, which is most often tidy
  • Import and export data using readr.
  • Combine multiple datasets using joins from dplyr.

Reading

Link Source
Introduction R4DS
Data Visualization R4DS
Workflow: Basics R4DS
Data Transformation R4DS
Workflow: Code Style R4DS
Data Tidying R4DS
Workflow: Scripts and Projects R4DS
Data Import R4DS
Workflow: Getting Help R4DS
Joins R4DS
Moneyball in R Instructor Website

Cheatsheets

Link Source
ggplot2 Posit Cheatsheets
dplyr Posit Cheatsheets
readr Posit Cheatsheets
tidyr Posit Cheatsheets

Data

Video

Title Link Mirror
10.1 - Welcome to Week 10 10.1 - YouTube 10.1 - ClassTranscribe
10.2 - Data Transformation: Import, Pivots, and Joins 10.2 - YouTube 10.2 - ClassTranscribe
10.3 - Moneyball in R 10.3 - YouTube 10.3 - ClassTranscribe
10.4 - Lab 07 10.4 - YouTube 10.4 - ClassTranscribe

Assignments

Assignment Deadline Credit
Lab 06 Thursday, October 31 100%
Quiz 06 Thursday, October 31 105%
Lab 07 Thursday, November 7 100%
Quiz 07 Thursday, November 7 105%

Office Hours

See Syllabus!