Data tidying

Lab-3

Dr. Elijah Meyer

Duke University
STA 199 - Summer 2023

2023-09-25

Check List

— Clone your individual lab-1 repo

— Note: This lab is due on Tuesday at 5:00 PM

Friendly Reminders

– single pipeline: no “breaks” in your code. Start with your data and use pipes until the finished product

– saving a variable: using the assignment arrow <- to save output as a variable

eval: false is a code chunk argument to have the code not run when you render your doc. Often used when we put incomplete or fill in blank code for you to edit. Make sure to remove this when you have finalized the code. This error can be caught if you look at your rendered doc!

Data Format (Wide vs Long)

Wide data contains values that do not repeat in the first column

Long data contains values that do repeat in the first column

Pivot Longer Example

Pivot Wider