R Tutorials for Biostatistics

The Lab Companion for BIOL 202 — UBC Okanagan

Author

Jason Pither

Published

September 5, 2026

Welcome

This is the lab companion for BIOL 202: Introduction to Biostatistics at the University of British Columbia, Okanagan campus. It provides the R tutorials for the lab portion of the course.

It also works as a general resource for anyone learning to manage and analyze data using R and R Markdown in the RStudio IDE.

These tutorials cover the computation; the lectures and assigned course readings cover the concepts. The approach is concept first, computation second: an idea is introduced in the lecture or the assigned reading, and the lab tutorial then implements it in R. If a tutorial asks you to run a test, you will already have learned what it is for.

This book is a living document that is updated intermittently. If you find errors or wish to provide feedback, please contact me.

About me

I (Jason Pither) am an Associate Professor in the Department of Biology at the Okanagan campus of the University of British Columbia. I am an ecologist with interests in biogeography, community ecology, and landscape ecology. I have been using “R” (and its predecessor, “S”) in my research for over two decades, and have been teaching Introductory Biostatistics using R since 2014.

Acknowledgements

I am grateful to be able to live, work, and play as a guest on the traditional, ancestral, and unceded territory of the Syilx (Okanagan) people. To find out more about Indigenous territories where you live, consult https://native-land.ca.

This online book borrows some material generously made openly available by the following keen educators:

It has also benefited from valuable input from the many BIOL202 students and teaching assistants who have helped me over the years. Thank you!

Clerissa Copeland, Jordan Katchen, and Mathew Vis-Dunbar helped with some of the content development and with identifying links to other UBCO Biology material. Thanks!

I used Claude (Sonnet 5 and Opus 5) to help translate this resource from R Markdown to Quarto, and to help design some sections’ content.

Licence

These tutorials are licensed CC BY-NC-SA 4.0.

Many of the datasets accompany Whitlock, M. C. & Schluter, D., The Analysis of Biological Data, and are redistributed under the same licence their authors published them under (Whitlock & Schluter 2018). Each dataset’s help page records its source. Note that most of those values were digitized from figures and tables in the original publications, so they are teaching reconstructions rather than the original measurements — fine for learning, not for research.