Installing R on Windows


R is a free software environment for statistical computing and graphics. Users, especially researchers might need a version installed on their computer.

R is a popular language used in many areas of research, and if installed by an administrator, not all components can be modified by a user. By installing it as a normal user without administrator rights, you retain the ability to change all versions of software and installed libraries, without needing assistance from IT.

This takes around 15 minutes, and does involve a fair number of steps to complete.  This is all documented with screenshots below, and there is also a bitesize video available from Research Computing that walks through the process, available here:

Bitesize video on installing R on Windows


Installation steps

Download files

Download the version of R you want:
https://cran.r-project.org/bin/windows/base/

The latest at the time of writing was https://cran.r-project.org/bin/windows/base/R-4.0.5-win.exe

Download RStudio Zip file:
https://www.rstudio.com/products/rstudio/download/#download

The latest at the time of writing was https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.zip

Download RTools:
https://cran.r-project.org/bin/windows/Rtools/

The latest at the time of writing was https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe

Installation

Once you've downloaded these you should have three files:

Downloaded Files

Install R

Double click R-4.0.5-win, and a series of dialog boxes will appear.  Unless otherwise noted, just select OK/Next:

Select Language

Setup Information

License Agreement

You do want to change the destination on the next screen.  In the example, we are using a user called "test".  Select a suitable path to install this to, such as the example here, "C:\Users\test\R\R-4.0.5".


Select Destination

Select Components

Startup Options

Additional Tasks

Complete

Install Rtools

Double click on rtools40-x86_64.exe
On the first screen, tell it where you want to install (C:\Users\test\R\rtools40 here):


Select Destination

Choose to save version information to registry, but not create start menu icons.

Select Additional Tasks

Ready to Install

Install RStudio

Right click RStudio-1.4.1106 and select Extract All:


Extract RStudio   

Then select a suitable directory to extract it to (in this case C:\Users\test\R\Rstudio-1.4.1106):
Select Path

Configuration

Using the file explorer browse to where you extracted RStudio, and within the bin directory, double click rstudio:

Run Rstudio

This will open RStudio up, and ask you to tell it which version of R to use.  Select Choose a specific version of R, and browse to your R install 

Choose R

In our case this is C:\Users\test\R\R-4.0.5

Select R install

When it asks you which version, choose the 64bit version:

Choose Version

At this point, the installation and configuration is complete, and you should have a working install of R, RStudio, and Rtools..  If you want to create a shortcut to RStudio for future use, you can right click the icon on the taskbar and select Pin to taskbar.