2.2 R on Windows

To install R on Windows, go to https://cran.r-project.org/bin/windows/base/, download the file, double-click it and run it. During installation, it is best to leave default options (such as the installation folder) unchanged. This makes it easier for other programs to know where to find R. Once installed, you will find two shortcuts for R on your desktop. These refer to the two versions of R that come with the installation - the 32-bit version and the 64-bit version. Which version you need will depend on your version of Windows. To find out which version of Windows you have, go to This PC (or My Computer), right-click and select Properties. Here you should find the version of Windows installed on your PC. If you have a 64-bit version of Windows, you can use either version. However, it is best to use the 64-bit version as it makes better use of your computer’s memory and runs more smoothly. If you have the 32-bit version of Windows, you must use the 32-bit version of R.

To install RStudio, go to https://www.rstudio.com/products/rstudio/download/ and download the free version of RStudio at the bottom of the page. Make sure you select Installers for Supported Platforms and select the option for Windows. Once downloaded, install the program leaving all settings unchanged. If all goes well, RStudio will have found your installation of R and placed a shortcut on your desktop. Whether you have a 32-bit or 64-bit version of Windows or R does not matter to RStudio. What does matter are the slashes. R uses slashes (/) instead of the backslashes (\) that Windows uses. So whenever you refer to a folder or file in R, make sure you reverse the slashes. For example, you should refer to a file that has the Windows address C:\Users\Desktop\data.csv as C:/Users/Desktop/data.csv.