This set of computer labs was written in R Markdown (Allaire et al. 2024) and created from assignments used in the course Data Analysis & Visualization in R at The Evergreen State College. If you’ve found your way here, then you are probably an Evergreen student (or know one), probably in the Master of Environmental Studies (MES) program, and want to get more practice using R. Each lab has a Citations section and links to background information.
If you’re an instructor/faculty and interested in using or adapting this for your own course(s) - feel free! As you’ll see, I’ve used a lot of different resources, and adapted material from many of those books or sites to create the exercises.
When the lab refers to a .csv file, those can be found
on the Statistics
Resources page of the MES Thesis site.
If you’re new to R, and/or just have never felt that comfortable using RStudio, then use some of resources below - or find your own - before jumping in to the labs.
Before starting, you should be able to:
One good resource is this McGill University Library site which has many specific pages that can help you get started:
Also helpful are these chapters from (Dauber 2024):
AND this chapter from (Wickham et al. 2023), which is especially important if you’re not used to working in R projects:
Finally, as you’ll see in Lab 1, I’m going to recommend the Wickham et al. approach to keeping the Source of Truth in your R scripts…
Lab 1: Workflow and Tidying is an introduction to the tidyverse collection of packages (Wickham 2023)
Lab 2: More tidying & ggplot continues with some additional tidying functions, and begins to use ggplot2 (Wickham et al. 2024), which is used for (nearly) all plotting and visualizations in the rest of the labs.
Lab 3: Logistic
Regression using glm() introduces the glm()
function, first with an example of simple linear regression but then
with an extended example of logistic regression.
I’ve had the privilege to teach with some remarkable teaching partners in the MES core program Research Design and Quantitative Methods, including Carri LeRoy, Shawn Hazboun, John Kirkpatrick and Kathleen Saul. My work in that course, and developing the dataR course as a follow up, was influenced by all of them.
My time to put together these materials and publish them was supported by The Evergreen State College Foundation through a Sponsored Research Grant.