Working with R & RStudio

An introduction to programming in R


NCEAS Learning Hub
coreR
May 2025

Welcome to programming in R


R is a great language to learn data-oriented programming because it is widely adopted, user-friendly, and (most importantly) open source!

Artwork by Allison Horst

So what is the difference between R and RStudio?

R vs RStudio


  • R is a knife. You have food to prepare, and the knife is one of the tools that you’ll use to accomplish your task.

  • RStudio is the kitchen. RStudio provides a place to do your work!

RStudio IDE


Let’s take a tour of the RStudio interface.

Quick Tip: You can change the default location of the panes, among many other things. More information here

Example Code


Creating an object

# think of this code as someone saying "important_value gets 12".
important_value <- 3*4