Week 3
Errors, data manipulation with
dplyr, ggplot: themes, colors, facets
Topics
Part 3:
- Getting help with errors
- Data manipulation with
dplyrpackage- pipe (
%>%or|>) - Rows:
arrange,filter - Columns:
select, tidyselect
- pipe (
- Saving data files
- More
ggplot- Themes, colors
- Boxplots
- Facets
Announcements
- TA’s office hours are Mondays 3:00-4:00 pm (Michael Daily) via Webex. Webex link is on main course page of Sakai.
- 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
part3. - Open RStudio by double-clicking on the project file called
BSTA_526_W26_class_materials_public.Rprojin the main OneDrive folder.
| Part | OneDrive folder | Slides | Webpage |
|---|---|---|---|
| 3 |
Readings
Required
ggplot2
- R4DS book
- Chapter 1: Data visualization intro
- Sections 9.1-9.3: Aesthetic mappings, geometric objects, facets
- Section 11.5: ggplot themes
dplyr
- R4DS book sections 3.1-3.3 (skip 3.3.1, which will be covered in part 4), 12.3
dplyrcheatsheet - one of the best references.- Combining functions using the pipe operator, |> which is mostly equivalent to %>%; if you’re confused about
|>or%>%, please read this.
Optional
ggplot2
If you are interested in learning more about ggplot:
- ggplot2 BERD workshop slides - lots more on different
geomsand how to customize plots - Themes to improve your ggplot figures by David Keyes is really helpful for learning how to do more styling.
- RStudio also publishes a ggplot cheat sheet that is really handy!
- Customizing ggplot2 Cheatsheet is also handy, because it organizes ggplot2 commands by task.
- Documentation for all
ggplotfeatures is available here. - New
ggplotoptions with the latest version 4 released in September 2025
janitor package
Take a look at the janitor vignette to learn more about functions include in the janitor package
Below are janitor functions being covered in part 3:
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 3 due on 01/29.
Recording
- In-class recording links are on Sakai. Navigate to Course Materials -> Schedule with links to in-class recordings.