Installing R and RStudio

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.

For installation issues and assistance, please visit a TTS Service Desk walk-up location or contact the 24/7 TTS Service Desk via it@tufts.edu or (617) 627-3376. Questions related to R usage and programming can be addressed to DataLab-Support@elist.tufts.edu or answered in person by a Data Lab Assistant.

Windows

The following instructions are suitable for all modern 64-bit systems, which include all machines running Windows 10 or newer. Users of older Windows operating systems should confirm the bit width of their machine and refer to the section on legacy systems for instructions specific to 32-bit systems if needed.

  1. Download and run the installer for the latest stable Windows version of R available
  2. Download and run the installer for the latest stable Windows version of RStudio Desktop
  3. Optional: Advanced users looking to use packages that require compilation should also install Rtools

macOS

The version of R and RStudio suitable for macOS systems depends on the version of the operating system and the type of processor used. The following instructions are suitable for macOS 11.0 Big Sur and newer. Confirm the version of your macOS before proceeding and refer to the section on legacy systems if needed.

  1. Determine whether your computer has an Apple Silicon or Intel processor
  2. Download and run the installer for the latest stable version of R available for your processor
    1. Apple Silicon: R-release-arm64.pkg
    2. Intel: R-release-x86_64.pkg
  3. Download and run the installer for the latest stable macOS version of RStudio Desktop
  4. Optional: Install Xcode Command Line Tools to support installation of 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 the tools are already installed, no further action is needed
    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)
  5. Optional: Install XQuartz to use certain advanced R components and packages that rely on X11 forwarding

Linux and Legacy Systems

Linux users should install R using the Linux package management system of their operating system. Alternatively, the R project provides installation instructions for Debian, Fedora/RedHat, and Ubuntu distributions. A suitable RStudio deb or rpm package can be downloaded from the RStudio Builds page.

The latest version of R suitable for legacy 32-bit Windows operating systems is R 4.1.3 but it is not supported by any 32-bit RStudio application. The latest version of RStudio to run on a legacy 32-bit Windows system is RStudio 1.1.463 and R 3.6.3 is the latest version of R it is compatible with.

The latest R and RStudio versions available for legacy 64-bit macOS operating systems are as follows:

Users of OS X 10.10 Yosemite or older should consult the R for macOS page to determine the most appropriate R version and use RStudio 1.1.463 or older. Legacy 32-bit Apple systems are not supported.

Other Things to Note

The use of package managers like Conda or Homebrew is not recommended on Windows and macOS systems as they might cause incompatibility with official R packages downloaded from CRAN.

Those interested in using R with the popular JupyterLab IDE should install an official R distribution from CRAN following the instructions above and then create an interactive kernel using the IRkernel package.