R is a free programming language and software environment for statistical computing. RStudio is an integrated development environment (IDE) for the R programming language that allows users to interactively work with their code and understand it better.

Use the instructions corresponding to your operating system to install both R and RStudio on your computer.
A printer-friendly PDF version of these instructions is available on Box and via direct download.
If needed, email DataLab-Support@elist.tufts.edu for assistance.

Jupyter users interested in R notebooks should install R following these instructions and then install IRkernel.
Installing R via conda is not recommended and likely to cause problems.

Windows

  1. Download and run the installer for your desired version of R
    1. Latest version of R (recommended)
    2. R 4.0.2 (used in the Data Lab and other Tufts computer labs)
    3. R 3.6.3 (required to run some legacy scripts)
  2. Download and run the RStudio installer corresponding to your operating system
  3. Optional: Advanced users looking to use packages that require compilation should also install Rtools

MacOS

  1. Install Xcode Command Line Tools to ensure proper installation of some R packages that require compilation
    1. Launch Terminal from Applications > Utilities > Terminal
    2. Type xcode-select --install and press enter
    3. If you get an error message stating that command line tools are already installed, proceed to install R and RStudio
    4. If a popup window appears, click Install and agree to the Terms of Service
    5. Wait for Xcode Command Line Tools to install, this may take several minutes
  2. Download and run the installer for your desired version of R depending on your operating system
    1. MacOS 10.13 (High Sierra) or later
      1. Latest version of R (recommended)
      2. R 4.0.2 (used in the Data Lab and other Tufts computer labs)
      3. R 3.6.3 (required to run some legacy scripts)
    2. Older versions of MacOS
      1. Find the most recent version of R available for your version of MacOS
  3. Download and run the RStudio installer corresponding to your operating system
  4. Optional: If needed, install XQuartz to use certain advanced R components and packages that rely on X11 forwarding

Linux

  1. Follow the instructions corresponding to your Linux distribution to install R
  2. Download and run the RStudio installer corresponding to your operating system