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.versionLook 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.

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
Go to https://cran.rstudio.com/ and click Download R for Windows.

Click install R for the first time.

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

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.
Go to https://posit.co/download/rstudio-desktop/ and click Download RStudio Desktop for Windows.

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:
Follow the steps in Installing R on Windows to download and install the latest R.
Open RStudio.
Go to Tools > Global Options.

Next to R version, click Change.

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

Restart RStudio for the change to take effect.
macOS
Installing R on macOS
Go to https://cran.rstudio.com/ and click Download R for macOS.

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

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

When the installer has finished, click Close.
Installing or updating RStudio on macOS
Go to https://posit.co/download/rstudio-desktop/ and click Download RStudio Desktop for macOS.
When the download finishes, open it and drag RStudio into your 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.

Ubuntu Linux
Installing or updating R and RStudio on Ubuntu
Open a terminal.
Update the list of available software:
sudo apt updateInstall or update R:
sudo apt install r-baseFor RStudio, go to https://posit.co/download/rstudio-desktop/ and scroll down to the download for your version of Ubuntu.

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.
install.packages(), then load it in
each session with library().
The RStudio pane (bottom left) where R runs commands and prints results,
warnings, and errors. Nothing typed here is saved.
A set of lines and blocks of code that work together to do a whole job.
R runs a program from top to bottom, so order matters.