2  Understanding the Interface (RStudio)

2.1 Opening RStudio

Let’s start by opening RStudio. The logo of the RStudio App should look like this

2.2 Understanding RStudio Layout

Once RStudio is open, you should see four windows

The R Studio interface

RStudio has 4 main windows

  1. The Script window: This is the area where you write your R code, known as scripts. This is the input window.

  2. Console window: This window shows both the output result of your R code.

  3. Environment/History window: In this window you can access your environment (your datasets, variables, functions, etc.) and your command history.

  4. The Utility window: View files, view plots, keep track and manage all your packages, access help and documentation about different functions.

2.3 Running Code

To run any code or line in RStudio, write your code in the Script window (top left window) and press ‘Ctrl+Enter’ or click on the ‘Run’ button.

For instance, let’s type on the Script window (top left window) 2 + 2

You should see the output 4 on the bottom left window.


Well-done you have run your very first line of code using R!