Software
To use the programming language R, you need to have both the R software downloaded, and a way to interact with that software. We will use the integrated development environment (IDE) RStudio for this task. To install the required software on your computer, please follow the instructions according to your operating system.
Windows
You will need to download R and RStudio separately.
R
First, follow the instructions to download R from the CRAN website for the most recent version.
Run the .exe file that was just downloaded and follow the instructions on screen to install the downloaded software locally on your computer.
RStudio
Go to the RStudio download page and identify the version for your operating system
Follow the on-screen instructions to download the software and install it on your local machine
Once it’s installed, open RStudio to make sure it works and that you don’t get any error messages.
macOS
R
Download R from the CRAN website
Select the .pkg file for the latest R version
Double click on the downloaded file to install R
It is also a good idea to install XQuartz (needed by some packages)
RStudio
Go to the RStudio download page
Go to the RStudio download page and identify the version for your operating system
Follow the on-screen instructions to download the software and install it on your local machine
Once it’s installed, open RStudio to make sure it works, and you don’t get any error messages
Linux
Follow the instructions for your distribution from CRAN they provide information to get the most recent version of R for common distributions. For most distributions, you could use your package manager (e.g., for Debian/Ubuntu run sudo apt-get install r-base and for Fedora yum install R, but we don’t recommend this approach as the versions provided by this are usually out of date. In any case, make sure you have at least R 4.1.1.
Go to the RStudio download page