Pivoting data

module 4
week 6
long data
pivoting
tidy data
wide data
Tidy up your data into long or wide format
Author

Jeff Stevens

Published

February 24, 2025

Tidy data is a specific form of data that let’s you apply formulas to your data for modeling or plotting. To make your data tidy, you may need to pivot it to a longer or wider format.

Learning objectives

  • Recognize tidy data
  • Pivot wide data longer
  • Pivot long data wider

Pre-meeting

To prepare for this class meeting, please do the following:

Class meeting

  • Define tidy data
  • pivot_longer()
  • pivot_wider()
  • Slides and Code

Homework after the class meeting

Wrap up this lesson

For next class meeting