2  Installing R/RStudio for Mac

Installing R and RStudio is usually straightforward if you follow these steps. The sections below explain how to install R and R Studio on a Mac. If you prefer to watch a video showing the steps, there is a helpful YouTube video here which covers installing on a Mac.

2.1 RStudio desktop download page

Go to the RStudio desktop download page here which you can see in Figure 2.1. This is hosted by Posit - the company who create and maintain RStudio as an Integrated Development Environment (IDE).

White background posit.co website for helping people install RStudio. On the left is a blue download and install R button. On the right is a blue download RStudio desktop for MACOS 12+ button.
Figure 2.1: Install R and Install RStudio page on posit.co.

They point you to two places to 1) install R and 2) install RStudio.

2.2 Step 1 - Install base R

The first step is installing base R. This is the software which contains all the functions and code you will use, but it is not very user friendly on it’s own. We must first install R before we install RStudio.

If you click Download and Install R, it will take you to the download page for R (Figure 2.2).

The CRAN site has a white background with a blue R logo in the top left corner. In the middle of the screen is a list of download options for different operating systems.
Figure 2.2: Home page for the R CRAN site.

You should click Download R for macOS and it will take you the download page (Figure 2.3). Highlighted in the black square, the top of the page will show the latest versions. If you have a new Mac with a silicon chip (if you are unsure click the Apple logo in the top left > About this Mac > Chip), click the top link to download the installation file. If you have an older Mac but latest operating system (OS), click the second link to download the installation file.

If you have an older Mac which does not support the latest version of R, you can scroll down the page to see different versions supporting older OSs, but please check with your course lead if you can only download an older version of R to check it is still suitable.

The CRAN site has a white background with a blue R logo in the top left corner. In the middle of the screen is a list of download options for different Mac versions. The top download link will be the most recent version of R for the newest Mac OS.
Figure 2.3: R for MACOS download page on CRAN.

Once you have downloaded the file, clicking on it should open the installation process. Click Continue on the first page (Figure 2.4).

The first R installation window as a black and dark grey square. This page is for the introduction for what the installation includes.
Figure 2.4: The first R installation window for Mac OS: Introduction.

The next page (Figure 2.5) - Read Me - explains what R is installing on your computer. Click Continue.

The second R installation window as a black and dark grey square. This page is for the read me which explains what the installation file includes and any computer requirements.
Figure 2.5: The second R installation window for Mac OS: Read Me.

The License (Figure 2.6) page explains the license R is covered under. Click Continue.

The third R installation window as a black and dark grey square. This page explains the license which R is released under.
Figure 2.6: The third R installation window for Mac OS: License.

After clicking Continue on the License page, it will ask you to agree to the licence (Figure 2.7). Click Agree.

The license window pops out as another black and dark grey square. You can agree or disagree to the license terms.
Figure 2.7: Agreeing to the R user license.
Installation location and path

On a Mac, it should automatically choose a location to install R and skip Destination Select, but if you do get the option it can often cause problems to install R on a network or cloud drive, such as OneDrive or DropBox. It is better to install these programs on your computer’s drive. Depending on your computer’s settings, you may have to get IT support to give you access to installing programs if you are using a work computer with restrictions.

The Installation Type (Figure 2.8) page explains how much memory the R install takes up on your computer. Click Install.

The fourth R installation window as a black and dark grey square. This page explains the memory R takes up on your computer. Here: 117.6 MB.
Figure 2.8: The fourth R installation window for Mac OS: Installation Type.

Depending on your computer, it will take a few seconds to a few minutes, and show as installation successful (Figure 2.9). Click Close.

The fifth and final R installation window as a black and dark grey square. There is a large green tick if the installation is successful.
Figure 2.9: The fifth R installation window for Mac OS: Summary.

After you click Close, it should offer to send the installation file to the bin now it has finished installing (Figure 2.10). Click Move to Bin.

After closing the R installation file, you see a small pop-out in dark grey. It asks you to keep the file or move it to the bin.
Figure 2.10: Moving the R installation file to the bin.

If you followed all of these steps, then you should have R successfully installed on your computer. You do not need to open it as we never actually use R on it’s own, but you need it installed before we download and install RStudio.

2.3 Step 2 - Install RStudio

If you closed the page down, go back to the RStudio desktop download page here which you can see in Figure 2.1.

This page should recognise what your OS is and the blue button will be customised to your OS. So, for a Mac user, it should prompt you to download RStudio for a MAC OS. Clicking this link will start downloading the file to your downloads folder.

If you have an older Mac and you cannot download the latest version of RStudio, click on the download a previous version link. You will see a list of previous versions under the RStudio IDE / Workbench heading.

Once the download has finished (depending on your computer and WiFi a few minutes to around 15 minutes), it will open in a folder (Figure 2.11). If you drag the white and blue RStudio logo into your Applications, you will be able to access it from your Applications folder.

After downloading the RStudio installation file, the white and blue RStudio file will open in a folder. Next to it, you can drag the file to the blue Applications folder.
Figure 2.11: Dragging the RStudio installation file to the applications.

When you open it for the first time, we recommend pinning it to your Dock ( control key and click > Options > Keep in Dock) so you always know where to find it.

If you have successfully installed R and RStudio, you should see a fresh RStudio window (Figure 2.12) when you open it from Applications or your Dock.

If the installation is successful, you can open RStudio as a piece of software on your computer. With default settings, it will open as a white background with three main windows: Console, Environment, and Files.
Figure 2.12: Default white theme RStudio window.

You are now ready to start working with R/RStudio from your course materials!

2.4 Getting help for installation problems

If you have any problems with installing R and R Studio on your computer, please attend the graduate teaching assistant support sessions for your course, speak to your course lead, or post on the Teams channel for your course/programme.