In the first two recipes, the steps were related to installing base R. To use R with an IDE where syntax highlighting features are available along with other options, you will need to install a preferred IDE software. RStudio is one of the most popular IDEs for R. In this recipe, you will learn from where, and how, to download RStudio and install it onto your computer.
To install an IDE, the first step is to install base R; that is, you need to make sure R has been installed prior to installing RStudio IDE. RStudio is an open source and enterprise-ready professional software for R. Now, let's take a look at the following few steps to download and install RStudio IDE:
- To download open source components of RStudio IDE, visit the web page at https://www.rstudio.com/products/rstudio/.
- From this link, choose RStudio for desktop and download the executable file. The latest version of RStudio is 1.0.136 at the time of the preparation of this recipe. Select an appropriate executable file from the list that matches with your operating system:
The following steps will help you go through the installation process:
- Go to the folder where you have stored the executable file of the latest release of RStudio:
- Right-click on it and select Run as administrator. The installation Wizard will open. Then, click on Next > on this screen.
- At this stage, you will be asked to give the location where you want to install it. The default location usually shows as C:\Program Files\RStudio. However, if you want to install into a different location, then you can do this from here and click on Next >:
- Now, you will be asked to give a name of the start menu folder and then click on Install.
Once you run the executable file of RStudio, it then checks whether there is any base R installed in the computer. If you do not already have R installed, then you will be given a message stating that base R is required to install RStudio. Once you have made sure that base R is already installed, it will install the IDE without any errors by following the steps mentioned in the How to do it… section.
The following screenshot is the initial user interface of RStudio where you will see four major components:
Let's take a look at the following four major components shown in the preceding screenshot:
- In the upper-left section is the R script writing section where you will usually write R code to solve your data analytics, data management, or data visualization problems.
- In the lower-left section is the R console where you will be able to see immediate output and error messages along the line of code that has been run already.
- The upper-right section contains the history of R sessions and the current global environment. The environment section displays all current active R objects, their type, and other information.
- The lower-right corner contains several subcomponents, for example, the Help documentation window, graphical output (the Plots tab), the Files tab showing the list of files and folders in the selected directory, and also the list of R packages (the Packages tab).
There is another similar IDE available, R tools for Visual Studio. This is another IDE developed and released by Microsoft. You will come into this recipe in this chapter.