Statistics Resources
The statistics labs in R linked below were created by John Withey (MES faculty, 2016-present) in 2025, based on his work in the MES core program Research Design & Quantitative Methods and elective Data Analysis & Visualization in R. They were originally designed to be completed in sequence, which is advised if you’re new to using R and RStudio, but were revised to be more or less stand-alone activities if you have some background in using R for statistical analyses.
The links are to specific pages on RPubs. Most labs use specific data files, so download those .csv files here before starting the lab. You can also save the lab instructions as an .html file, to use offline in the future.
Data Analysis & Visualization in R for Environmental Studies
Introduction to the series of labs as a whole (please read before jumping into any of the Labs!). This page has links for getting started in R and RStudio.
Lab 1: Workflow and Tidying is an introduction to the tidyverse collection of packages. Download these two .csv files:
Lab 2: More tidying & ggplot continues with some additional tidying functions, and explores more uses of ggplot2, which is used for (nearly) all plotting and visualizations in the the labs. Uses built-in datasets available in R (no downloads needed).
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. Download these two .csv files:
Lab 4: Modeling discrete count data demonstrates ways to model the response of count data to multiple independent variables, first with Poisson regression using glm(), then with other alternative models using glm.nb(), zeroinfl(), and hurdle().
(last updated 3/3/2025) …with more Labs to come!