Skip to content
Join our email list to get $80 off Ally in November →
R for the Rest of Us Logo

R in 3 Months (Fall 2026)

Week 6 Live Session (Fall 2026)

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

In this week 6 session we covered tidy data: the three rules, how to spot untidy data, and how to fix it with {tidyr} functions. David also coded live with a fake soccer training survey, splitting it into smaller data frames, analyzing them, and joining them back together, and we previewed the rest of the course.

You'll learn:

  • How to check whether data is tidy by asking whether you could plot it, and by identifying your unit of analysis
  • How to use pivot_longer() to turn year columns into year and value variables, and pivot_wider() to reshape results for a display table
  • How to split multi-value cells with separate_wider_delim() and separate_longer_delim()
  • How to break a messy survey data set into smaller tidy data frames that share a respondent ID, then rejoin them with left_join()
  • How to turn non-numeric responses like 'skipped' into NA with parse_number() or when reading in data, and trim stray spaces with str_trim()

Resources mentioned:

Key moments:

  • 02:11 Housekeeping and review of last week's AI session
  • 04:07 Overview of the remaining course weeks
  • 09:40 Participants share first reactions to tidy data
  • 12:44 AI tools now default to tidyverse-style R code
  • 18:30 Rule one: year spread across columns, fixed with pivot_longer()
  • 21:15 Participant asks why pivot long and when to keep data wide
  • 32:41 Splitting an address cell with separate_wider_delim()
  • 34:07 Select-all-that-apply answers and separate_longer_delim()
  • 39:26 Live coding: cleaning non-numeric survey responses to NA
  • 41:49 Using parse_number() as an alternative to fix numeric columns
  • 47:49 Participant question on whitespace, str_trim() and str_squish()
  • 54:11 Joining demographics back in with left_join() to group by city
  • 57:30 Participant asks how to handle missing data, {naniar} package

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Course Content

143 Lessons

New from Ally Translate between base R and the tidyverse