Skip to main content

Installing and Updating R, RStudio, and Rtools

Before you start work in this class, make sure the latest versions of R and RStudio are installed on your computer. Install R first, then RStudio: RStudio can’t run any code until R is installed. On Windows, also install Rtools, which some packages need. Everything here is free.

Current versions (as of August 13, 2026)

  • R: 4.6.1
  • RStudio: 2026.08.0-187

Checking your version of R

When you start RStudio, the Console shows which version of R is running, next to the R logo at the top of the Console. You can also type this in the Console:

R.version

Look for version.string in the output. If your version is older than the current version above, follow the steps to update R for your operating system.

RStudio Console showing the output of R.version, with the R version shown at the top of the Console and on the version.string line both underlined.

The RStudio Console after running R.version. The top of the Console shows R 4.5.1, and the version.string line reads “R version 4.5.1 (2025-06-13 ucrt)”.

Windows

Installing R on Windows

  1. Go to https://cran.rstudio.com/ and click Download R for Windows.

    The CRAN Download and Install R box, with an arrow pointing to the Download R for Windows link.

  2. Click install R for the first time.

    The R for Windows page on CRAN, with an arrow pointing to the install R for the first time link next to base.

  3. Click Download R (version) for Windows. The version shown will be the current one.

    The CRAN page for the current R for Windows release, with the Download R for Windows link at the top.

  4. Go to your Downloads folder (or wherever the file was saved) and run the program to install R. You can accept the defaults.

Installing Rtools on Windows

Rtools lets R build packages from source, which some packages need. Go to the Rtools page on CRAN, pick the Rtools version that matches your version of R, download it, and follow its install instructions.

Installing or updating RStudio on Windows

Installing and updating RStudio are the same: download the latest version and install it.

  1. Go to https://posit.co/download/rstudio-desktop/ and click Download RStudio Desktop for Windows.

    The Posit download page, step 2: Install RStudio, with an arrow pointing to the Download RStudio Desktop for Windows button.

  2. Go to your Downloads folder (or wherever the file was saved) and run the program to install RStudio. You can accept the defaults.

Updating R on Windows

If you have an older version of R, update it:

  1. Follow the steps in Installing R on Windows to download and install the latest R.

  2. Open RStudio.

  3. Go to Tools > Global Options.

    RStudio with the Tools menu open and an arrow pointing to Global Options at the bottom of the menu.

  4. Next to R version, click Change.

    The RStudio Options window on the General tab, with an arrow pointing to the Change button next to the R version.

  5. Click Choose a specific version of R, select the latest version, and click OK.

    The Choose R Installation window with Choose a specific version of R selected, the newest R version highlighted in the list, and the OK button marked.

  6. Restart RStudio for the change to take effect.

macOS

Installing R on macOS

  1. Go to https://cran.rstudio.com/ and click Download R for macOS.

    The CRAN home page with the Download R for macOS link circled.

  2. Download the .pkg file for your version of macOS. On a Mac with Apple silicon (M1 or newer), that’s the arm64 .pkg.

    The R for macOS page on CRAN with the box for the Apple silicon arm64 .pkg download highlighted.

  3. When the download finishes, open it to start the installer and click Continue through the steps.

    The R installer for macOS on its Introduction step, with an arrow pointing to the Continue button.

  4. When the installer has finished, click Close.

Installing or updating RStudio on macOS

  1. Go to https://posit.co/download/rstudio-desktop/ and click Download RStudio Desktop for macOS.

  2. When the download finishes, open it and drag RStudio into your Applications folder.

    The RStudio installer window on macOS, with an arrow showing the RStudio icon being dragged onto the Applications folder.

Updating R on macOS

Download and install the latest R as in Installing R on macOS. To switch between versions of R, you can use the free RSwitch menu bar utility, which can also download R for you. Restart RStudio for the change to take effect.

The RSwitch web page, with a Download RSwitch button and a screenshot of its menu listing installed R versions and other options.

The RSwitch web page and its menu bar menu, which lists the installed R versions so you can pick one.

Ubuntu Linux

Installing or updating R and RStudio on Ubuntu

  1. Open a terminal.

  2. Update the list of available software:

    sudo apt update
  3. Install or update R:

    sudo apt install r-base
  4. For RStudio, go to https://posit.co/download/rstudio-desktop/ and scroll down to the download for your version of Ubuntu.

    The table of RStudio downloads on the Posit site, with arrows pointing to the Ubuntu 22 and Ubuntu 24 downloads.

RStudio in the cloud

You can get a free cloud-based RStudio account at https://posit.cloud/. The free version limits how much you can store, but it works great! If you don’t have a fast computer, or don’t have a laptop or desktop, this is a good option.