What is R?

by Grace Yuh Chwen Lee, Spring 2024

R is a programming language for statistical computing and data visualization. It is widely used in diverse disciplines, from statistics all the way to…. biology! In addition to core R, a large number of extension packages significantly augments the capabilities of R (and you can be an R developer too!).

R is free and open-sourced.

How to get R and Rstudio?

You need to download R and Rstudio separately.

For Windows

Download R-4.3.3 (Spring 2024) here: https://cran.r-project.org/bin/windows/base/ (on the top of the page)

Run .exe file downloaded and follow the instructions on the screen to install R on your computer.

After you installed R, you need to install Rstudio, an integrated development environment (IDE) for R. It makes R easier to use, as it is a relatively user-friendly environment.

Download Rstudio here: https://posit.co/download/rstudio-desktop/ (either appear on the right side, immediately below “2. Install Rstudio” or scroll down to find for Windows 10/11)

Run .exe file downloaded and follow the instructions on the screen to install Rstudio on your computer.

Once installed, open Rstudios to make sure it works fine on your computer!

For MacOS

Download R-4.3.3-arm64.pkg (Spring 2024) here: https://cran.r-project.org/bin/macosx/ (middle of the page)

Double click the downloaded pkg file to install R on your computer.

After you installed R, you need to install Rstudio, an integrated development environment (IDE) for R. It makes R easier to use, as it is a relatively user-friendly environment.

Download Rstudio here: https://posit.co/download/rstudio-desktop/ (either appear on the right side, immediately below “2. Install Rstudio” or scroll down to find for macOS 12+)

Double click the dmg file and follow the instructions on the screen to install Rstudio on your computer.

Once installed, open Rstudios to make sure it works fine on your computer!


R Studio Windows

When working in R Studio, you will generally see 4 windows:

  1. Source: This is where you write your code. It will not be evaluated until it is run in the console. You can generate a new .R file by clicking on File > New File > R Script.

  2. Console: This is where your code from the source is evaluated by R. You can also type code directly into the console for quick calculations that you don’t need to save.

  3. Environment/History: The environment tab shows variables you have defined (see below) in your working space. The history tab shows your command history.

  4. Files/Plots/Packages/Help: Here, you can view your file directories, plots, packages, and access R Help.

You can change the order and size of these windows as well as minimize/maximize certain windows according to your preferences.