R is a powerful programming language designed for statistical computing and graphics.

RStudio is an integrated development environment that makes working with R more intuitive and user-friendly.

This guide is meant for first time users of RStudio.

Step 1: Install R

R is the language you’ll be writing in, so it needs to be installed first.

  1. Go to the CRAN website: https://cran.r-project.org
  2. Download and run the installer for your respective operating system using default settings.

Once installed, R will be available on your system - but you typically won’t use it by itself.

Step 2: Install Rstudio

RStudio is where you’ll write, run, and manage your R scripts. It wraps all of R’s power into a much friendlier interface.

  1. Go to the RStudio download page: https://posit.co/download/rstudio-desktop/
  2. Choose RStudio Desktop (free version) and download the version for your operating system.
  3. Run the installer and follow the prompts. When it’s done, open RStudio—you’re ready to go.

When installed, your RStudio environment should resemble this:

image.png

In order to execute code, create a new R Script file: File → New File → R Script

The shortcut for this is Cntrl/Cmd + Shift + N