R Primers for Geoscientists
Interactive tutorials that teach the basics of R. The code runs in your browser, so there is nothing to install.
Before Week 1
Work through these two tutorials, in order. Together they take two to three hours.
- Programming basics: functions, arguments, objects, vectors and types. The last two parts, on lists and packages, are optional.
- Working with data: loading a CSV file, inspecting it, summarising and plotting it, and writing your own functions.
Everything else on this site is optional. It covers {ggplot2} and {dplyr}, which the course teaches from Week 2, so it’s useful for a head start or a refresher.
These tutorials support the Research Skills for Geoscientists course at Durham University. See the course’s preparation guide for the rest of what to do before term starts.
License
This site is a fork of Andrew Heiss’s webR version of the Primers, which is itself based on the RStudio/Posit Primers developed by the RStudio/Posit Education Team and made open source on GitHub. Following the original license, these tutorials are licensed under the Creative Commons Attribution-ShareAlike 4.0 License (CC BY-SA 4.0). See the About page for what this fork changes.
The primers are derived from the book R for Data Science from O’Reilly Media, Inc. Copyright © 2017 Garrett Grolemund, Hadley Wickham. Used with permission.