Week 6
Start with your goal: more data wrangling
Topics
Finish Part 5:
- Learn about wide vs long data and how to reshape data
- apply
pivot_longer()to make a wide dataset long
- apply
Part 6:
- Practice thinking through and planning ahead data wrangling steps to prepare a dataset ready for analysis
- Practice working with real data
- Practice cleaning variables
- Practice merging datasets with
bind_rowsandjoining - Practice making data long by
pivoting - Practice making complex visualizations with ggplot
Announcements
- Functions of the Week
- Signup sheet for your functions of the week presentations. The file is in OneDrive in the functions_of_the_week folder.
- Presentations will be during weeks 5-10. Please no more than 4 presentations per week.
- If there is a function you are interested in presenting that is not on the signup sheet, please check with me. If it hasn’t been covered before and isn’t covered in the class, then most likely I will approve it.
- The Midterm is posted on OneDrive. It is due Sunday 2/22/26.
- Please start early on this since finding a suitable dataset might take some time.
- I encourage you to meet with me to discuss your research question and data, to make sure you are on the right track.
- Cascadia R Conf in June 26-27 this year. It will be held at OHSU in RLSB. This is a great conference to meet other R enthusiasts in the area and learn more about what they are working on.

Class materials
- Class materials in OneDrive folder BSTA_526_W26_class_materials_public.
- For today’s class, make sure to download to your computer the folder called
part6. - Open RStudio by double-clicking on the project file called
BSTA_526_W26_class_materials_public.Rprojin the main OneDrive folder.
We will first finish the Week 5 slides, starting with Section 10 on Reshaping data.
Link to Sakai for link to Week 6 group work files
| Part | OneDrive folder | Slides | Webpage |
|---|---|---|---|
| 5 | |||
| 6 |
Readings
- None
- During Week 6 I listed some optional readings here, which I moved to Week 7 since they more closely relate to the Week 7 material.
Post-class survey
- Please fill out the post-class survey to provide feedback. Thank you!
- Previous muddiest points and clearest points with responses are collected here.
Homework
- See OneDrive folder for homework assignment.
- HW 6 due on 02/12.
Recording
- In-class recording links are on Sakai. Navigate to Course Materials -> Schedule with links to in-class recordings.