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.
R is the language you’ll be writing in, so it needs to be installed first.
Once installed, R will be available on your system - but you typically won’t use it by itself.
RStudio is where you’ll write, run, and manage your R scripts. It wraps all of R’s power into a much friendlier interface.
When installed, your RStudio environment should resemble this:

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