Getting Started with R
R is a powerful statistical and programming language. However like any command line program, it can have a steep learning curve at the beginning. If you are new to R, check out the following resources to help you get started (and if you have other suggestions, please leave a comment below!).
Setting up R & RStudio
Note: if you're signed-up for one of our R workshops, you must have R and RStudio installed and working before the workshop. We don't have time during workshops to help people set up their software, but we're very happy to help people get set up beforehand. If you're having trouble, feel free to get in touch, sign-up for Office Hours, or try RStudio Cloud.
Installing R on your computer
Installing R and RStudio are normally pretty easy. If you're starting from scratch, install R first and then RStudio. Don't try to install them on a network drive (like your DropBox or Google Drive). If you have questions or problems, try the guides below or let us know.
These are the basic steps:
1) Download R: Follow the links according to the operating system you are running. Download the package, and install R onto your computer. You should install the most recent version (at least version 4.0).
2) Download RStudio: Install RStudio Desktop (free version is fine). Do this after you have already installed R.
Video Guide
- How to install (and update) R and RStudio (6 min). From R for Ecology.
R Packages
- Depending which workshop you're taking, you might also need to install some R packages (i.e., addons). The instructor will provide further instructions in the workshop description or welcome email.
RStudio Cloud
RStudio Cloud is a virtual environment that allows you to run R in a browser. This is generally recommended for beginners. If you use RStudio Cloud for a workshop, you won’t have to install any software or data on your computer. The instructor will send a link to a RStudio Cloud project that you can click on to ‘clone’ into your own workspace. The project will contain all the scripts, packages, and data you'll need.
RStudio Cloud functions nearly identical to RStudio Desktop, and works quite well as long as you have reasonably good internet connection. It's not as bandwidth demanding as Zoom, so if you can Zoom you can use RStudio Cloud.
RStudio Cloud requires setting up an account. The free account provides up to 25 hours of project time per month, which is more than enough for a couple of workshops. You can create your RStudio Cloud account with any email address, or use your Google or GitHub credentials. Start here: https://rstudio.cloud/
Getting Started with R - Live Training
- UC Davis - DataLab workshops. Look at both upcoming and past workshop (most of which include recordings).
- UC Berkeley - DLab workshops. UC Berkeley affiliates only.
- UCLA - R classes and seminars
Self-Paced Tutorials and Short Workshops
- RStudio Primers are short online tutorials that cover basic concepts. They include videos and short code challenges to complete within the browser. Recommended.
- RStudio Tutorials are short self-paced tutorials you do right within RStudio. Start by going to the 'Tutorial' tab in RStudio.
- Introduction to R. Self-paced course by Claudia Engel.
- Introduction to Basic Statistics in R. 2-part recorded workshop from the UC Davis DataLab. Workshop materials & scripts.
Short Courses
- Learning R (~3 hrs). LinkedIn Learning (free to UC ANR employees)
- Introduction to R. Self-paced course from DataCamp. ~4 hours of content. No videos. Free. Account required.
- R Basics: Introduction To Programming For Researchers (4-Part Series). Recorded workshop series from the UC Berkeley DLab, May 2021.
- R Programming. MOOC from Coursera. Free to audit.
- Data Wrangling in R with the Tidyverse (~3 hrs). LinkedIn Learning (free to UC ANR employees)
- R Programming Fundamentals. edX course by Susan Holmes. Free to audit.
- Basics of R for Ecologists. Self-paced video course in English and Spanish. Sliding scale fee.
Cheatsheets
"Finding the right R function, half the battle is."
- Master Jedi Yoda
R for Ecology cheatsheet (video overview)
Comments & Suggestions
Do you know another resource for learning R? Found a broken link? Please let us know by making a comment below.