NEPTUNIAN ANALYTICS

How to Install R and RStudio on Windows

Are you interested in beginning your R programming journey? Or an R programmer looking to download R onto your device? This tutorial provides a comprehensive step-by-step guide to downloading R and RStudio onto Windows devices.

R is an open-source, high-level, domain-specific programming language for statistical computing and data visualisation. It was started by University of Auckland professors Ross Ihaka and Robert Gentlemen and is based on the statistical S programming language.

R was first released to the public in 2000. The language supports a variety of statistical and visualisation techniques such as modelling, statistical testing and classic graphic representations. R is widely used in statistics, data analytics, data science & bioinformatics. A survey conducted by Statista reveals R to be amongst the most commonly used programming languages.

RStudio is an IDE for the R programming language. RStudio is available in two formats: as a desktop application or on the cloud. In addition to R, RStudio can also be used to run Python commands.

Keep reading to see how to download R and RStudio onto your device.

Installing R

  • R for Windows can be installed here. Click on Download R for Windows > Install R for the first time. > ‘Download R-version for Windows’. At the time of writing, the version was 4.4.1. So, it was ‘Download R-4.4.1 for Windows’. This will begin installing R onto your device.
  • After downloading R, open the file in your downloads. The file will be named something like R-4.4.1-win.exe.
  • You will then be asked if you want to allow the app to make changes to your device. Click yes.
  • First, you will be asked to select the language you want to use during the installation. Select the language of your choice and click ‘OK’.
  • Next, you will see an information tab from the GNU General Public Licence. Once you have finished reading the document, if you are happy, click next.
  • The next stage is to decide where R should be installed on your device. The default path is typically C:\Program Files\R\R\R-version. With version being the version of R you have installed, so in this case, 4.4.1. You can change this if you would like. However, it would be preferable to keep the default path. Click next.
  • Select the components you want to install. In the drop-down menu, you will see two options: user and custom installation. These options both provide you with three components:
    • Main files: These are the core components of R you must install.
    • 64-bit files: This installs the 64-bit version of R, which is beneficial for those using a 64-bit operating system as it can access much more memory, which is helpful when working with large datasets.
    • Message translations: These language packs provide translations of R’s messages (including error, warning messages and menu labels) into different languages, which is helpful for those for whom English is not their first language.
  • The next step is to decide whether you want to accept the default start-up or customised options. Unless you have a specific reason for selecting customise, click accept defaults and press next.
  • Next, select a start menu folder to place the programs’ shortcuts. You can also choose not to create a start menu folder, but it is beneficial to do so for easy access to R and its associated tools. Click next.
  • You will now see the ‘Select Additional Tasks’ section.
    • This has the additional shortcuts: create a desktop shortcut & quick launch shortcut.
      • The desktop shortcut will add an icon to your desktop to allow easy access to R.
      • The quick launch shortcut adds a button to the quick launch toolbar at the bottom of your window to allow instant access.
    • There is also the option to save a version number in the registry. This refers to whether you wish to store the download of this R in the Windows registry.
      • The Windows registry is a database that stores information such as what applications are installed on the computer. Saving a version number in the registry enables more efficient tracking and software integration of your R download.
    • Finally, there is the option to associate R with .RData files.
    • Once you are happy with your selections, press next. This will start downloading R onto your device. This may take a couple of minutes.
  • Once the installation is done, click ‘Finish’ to exit the setup.

Installing RStudio

Once you have successfully installed R, you can then proceed to install the R IDE RStudio by following the steps below.

  • RStudio can be downloaded here. Click on the ‘download RStudio desktop for Windows’ button. This will begin installing RStudio onto your device.
  • Once the download has finished, open the file in your downloads. You will then be asked if you want to allow the app to make changes on your device. Click yes.
  • Next, you will see Welcome to RStudio Setup. You will be advised to close other applications before starting the setup so the relevant files can be updated without rebooting your computer. If you wish to close other applications, do so now and then click next.
  • The next stage is to choose the path where you want RStudio installed. The default path is typically C:\Program Files\RStudio. You can change this if you like; however, it would be preferable to keep the default path. Click next.
  • The final stage is to choose the start menu folder for the program’s shortcuts. You can also choose not to create shortcuts. However, creating a start menu folder shortcut provides easier access to RStudio. When you are happy, click ‘Install’ to install RStudio onto your device. This may take a couple of minutes.
  • Once the installation is complete, click ‘Finish’ to close the pane.

Conclusion

Well, there you have it. We hope you enjoyed this tutorial on installing R and RStudio on Windows devices.