1  Installing R/RStudio for Windows

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 Windows computer. If you prefer to watch a video showing the steps, there is a helpful YouTube video here which covers installing on Windows.

1.1 RStudio desktop download page

Go to the RStudio desktop download page here which you can see in Figure 1.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 Windows button.
Figure 1.1: Install R and Install RStudio page on posit.co.

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

1.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 1.2: Home page for the R CRAN site.

You should click Download R for Windows and it will take you the R for Windows page (Figure 1.3). Click Base for installing R the first time.

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 Windows including base and Rtools.
Figure 1.3: R for Windows on the CRAN site.

This will take you to the Windows download page (Figure 1.4). Click Download R for Windows at the top of the page. This will be the latest version available to you and it will start downloading to your downloads folder. Double click on the file when it has finished downloading.

If you have an older computer which does not support the latest version of R, you can select a different version supporting older operating systems from the Previous releases link, 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. At the top of the page is a blue download R-4.4.1 for windows link to start the download process.
Figure 1.4: R download page on CRAN.

Once you have double clicked the installation file, the first window (Figure 1.5) will get you to confirm the setup language. Click OK.

The installation screen is a white and grey box. Here, the setup language menu is a drop-down with English as the default and a blue OK button.
Figure 1.5: R installation process: Select setup language.

The information window (Figure 1.6) will explain what it is installing the user license. Click Next.

The installation screen is a white and grey box. Here, the information page lets you scroll through the license and explains what R installs.
Figure 1.6: R installation process: Information.

The destination location window (Figure 1.7) will ask you to confirm where it should install R to. It is important this installs to your C: drive which should be the default. Click Next.

The installation screen is a white and grey box. Here, the select destination page lets you browse through your computer files to choose a folder to save R in. The default should be a C: drive.
Figure 1.7: R installation process: Select destination location.
Installation Location

It can often cause problems to install R on a network or cloud drive, such as OneDrive or DropBox. It’s better to install these programs on your computer’s drive (C:). Depending on your computer’s settings, you may have to get IT support to give you access to installing programs.

It can also cause rare, but hard-to-debug problems if any of the folders in the path where you install R have non-Latin characters, including Chinese characters or Latin characters with accents (e.g., C:\\Daniël\Programs\). Try and avoid these wherever possible.

The select components window (Figure 1.8) lets you select which components it should install, but leave these all ticked. Click Next.

The installation screen is a white and grey box. Here, select components page allows you to select what is installed. There should be three default boxes ticked for main files, 64-bit files, and message translations.
Figure 1.8: R installation process: Select components.

The startup options window (Figure 1.9) asks if you want to customise the startup options, but leave this as No for the default options. Click Next.

The installation screen is a white and grey box. Here, startup options allows you to customise the options, but the default should be no.
Figure 1.9: R installation process: Startup options.

The select additional tasks window (Figure 1.10) asks if you want to add any additional steps in the installation process, but leave these ticked/unticked as default. Click Next to start the installation process.

The installation screen is a white and grey box. Here, you can select shortcuts to create for R which should be unticked, and two registry entries which should be ticked.
Figure 1.10: R installation process: Select additional tasks.

Depending on your computer, it will take a few seconds to a few minutes to successfull install R (Figure 1.11). Click Finish to complete this part of the process.

The complete installation process is a white box confirming you have completed the setup process.
Figure 1.11: Complete R installation process.

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.

1.3 Step 2 - Installing RTools

This is technically an optional step, but after you install R it is a good idea to install RTools. You can get started without installing RTools, but if you are having problems with installing and loading some packages, this should be the first thing you try.

If you go back to the R for Windows page (Figure 1.3). This time, click RTools and it will take you to the RTools download page (Figure 1.12). Click the top RTools option for the latest release. If you had to install an older version of R in Step 1, select a version of RTools consistent with the version of R you installed.

The CRAN site has a white background with a blue R logo in the top left corner. On this page, there is a list of RTools versions to download, you should select the top most recent version.
Figure 1.12: RTools page on the R CRAN site.

On the Rtools for Windows page (Figure 1.3), half way down you will see an Rtools installer link. Click this link and it will start downloading to your downloads folder. Double click on the file when it has finished downloading to start the installation process.

The CRAN site has a white background with a blue R logo in the top left corner. Half way down the page, there is a link to download the RTools44 file which is called Rtools44 installer.
Figure 1.13: RTools44 page on the R CRAN site.

The first window will ask which folder on your computer you want RTools saving to (Figure 1.14). Like the R installation, the default should be your C: drive, and it is important you save it your computer’s system files rather than in a cloud folder like OneDrive or DropBox. Click Next.

The installation screen is a white and grey box. Here, the select destination page lets you browse through your computer files to choose a folder to save R in. The default should be a C: drive.
Figure 1.14: Rtools installation process: Select destination location.

The select additional tasks window (Figure 1.14) asks if you want anything extra in the installation process, but keep these ticked/unticked as the defaults. Click Next.

The installation screen is a white and grey box. Here, the select additional tasks page lets you select two options. Save version information should be ticked and create start menu icon should be unticked bt default.
Figure 1.15: Rtools installation process: Select additional tasks.

The ready to install window (Figure 1.14) is the final step before the installation starts. Click Install.

The installation screen is a white and grey box. Here, the ready to install page confirms the destination location and additional tasks before you click install.
Figure 1.16: Rtools installation process: Ready to install.

Depending on your computer, it will take a few seconds to a few minutes to successfully install RTools (Figure 1.17). Click Finish to complete this part of the process.

The complete installation process is a white box confirming you have completed the setup process.
Figure 1.17: Complete Rtools installation process.

You never need to do anything with RTools, it just exists in the background to help install certain R packages.

1.4 Step 3 - Install RStudio

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

This page should recognise what your operating system (OS) is and the blue button will be customised to your OS. So, for a Windows user, it should prompt you to download RStudio for Windows. Clicking this link will start downloading the file to your downloads folder. Once it has finished downloading, double click on the file to start the installation process.

The first page of the setup process (Figure 1.14) explains what it will do and requests you close down other programmes first. Click Next >.

The first installation page explains what RStudio is installing and requests you close down other programmes. The box is white with a blue computer logo on the left.
Figure 1.18: RStudio installation process: Welcome.

The install location page (Figure 1.15) confirms where on your computer it installs to. Like the other steps, this should be on your C: drive and be the default option. Just make sure it is not saving to a cloud drive like OneDrive or DropBox. Click Next >.

The installation screen is a white and grey box. Here, the select destination page lets you browse through your computer files to choose a folder to save RStudio in. The default should be a C: drive.
Figure 1.19: RStudio installation process: Choose install location.

The start menu page (Figure 1.16) allows you to select where RStudio will appear on your start menu. The default will just be a folder called RStudio, so keep the default option. Click Next >.

The box is white and grey. Here, you can choose a start menu folder to create as a shortcut. The default should be creating a folder called RStudio.
Figure 1.20: RStudio installation process: Choose start menu folder.

Depending on your computer, it will take a few seconds to a few minutes to successfully install RStudio (Figure 1.21). Click Finish to complete this part of the process.

The complete installation process is a white box with a blue computer logo on the left confirming you have completed the setup process.
Figure 1.21: Complete RStudio installation process.

If you have successfully installed R and RStudio, you should see a fresh RStudio window (Figure 1.22) when you open it from the RStudio folder in your start menu. So you can always find it, when you open RStudio for the first time by clicking on it’s blue and white R logo, right click and Pin to taskbar. This way, it will always be available via your taskbar at the bottom of the screen.

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 1.22: Default white theme RStudio window.

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

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