R Studio installation for Windows

This tutorial is structured in a way that you will start by exploring what an RStudio is and how to install RStudio into your system. After that, I will help you to get familiar with RStudio - the specialties of different tabs like the console, environment, history, package, etc.

What is RStudio?

RStudio is an Integrated Development Environment(IDE) used for running the R programming language. Like many other IDEs, RStudio also has a console, syntax highlighters and other graphical user tools for plotting and modeling, etc.

RStudio is available in two editions - open source(free) and commercial license. 

How to install R studio?

  1. To install RStudio into your system, either visit the link - https://www.rstudio.com  or type r studio in your favorite browser and choose “Download the RStudio IDE”.
    R STUDIO INSTALLATION  FOR WINDOWS
  2. On hitting on download, you will be directed to the page as shown below.
    R STUDIO INSTALLATION  FOR WINDOWS
  3. Now scroll down the above page to the location where all download options are listed. You can choose the free version to download it free or else can go for other options.
    R STUDIO INSTALLATION  FOR WINDOWS
  4. Clicking the download button will take you to the page where all installers are listed. Based on your operating system you can use a new version or an old version of RStudio.
    R STUDIO INSTALLATION  FOR WINDOWS
  5. Hitting on the version will allow you to download the RStudio installer to your system. Now open the RStudio installer to set it up in your system. A window like the below will appear on your screen. Click on the Next button to proceed.
    R STUDIO INSTALLATION  FOR WINDOWS
  6. Now you can select the folder where you want to install the RStudio by browsing the location. Then click Next.
    R STUDIO INSTALLATION  FOR WINDOWS
  7. Here, you can choose the start menu folder where you want to create the shortcut. Then hit the Install button.
    R STUDIO INSTALLATION  FOR WINDOWS
  8. Hitting the Install button will begin the installation and on completion, you will get a screen with a window below. Finally, exit the Rstudio setup by clicking the Finish button.
    R STUDIO INSTALLATION  FOR WINDOWS

Familiarising with R studio

Now R studio is successfully installed on your system and you can start using it to code your own R programs. Before writing an R program in Rstudio, let’s familiarize ourselves with RStudio. Following the step-by-step guide will educate you in using the IDE smoothly. 

  1. To open a Rstudio application, you should remember the folder where Rstudio is installed in your system. Ideally, it will be in the bin folder. The path is as follows: C drive -> Program Files ->RStudio -> bin.
    R STUDIO INSTALLATION  FOR WINDOWS
  2. Double-clicking on the Rstudio will open the Rstudio application. The first look of Rstudio will give you a layout like below with three different panes. Each pane contains specific tabs that do specific functions. 
    R STUDIO INSTALLATION  FOR WINDOWS

Important R studio tabs and their functions

1.    The Console 

The Console tab in RStudio is the place where we write and execute the R programs. In other words, the console takes the inputs, does the operation, and displays the output at the same time. 

Besides these, the console gives you some basic information about the R you are dealing with. You can have a look at the information and try to learn more about R by typing the commands in the cursor. 

Let’s see how the console operates and what are the basic operations you need to accustom to while working with RStudio Console.

  1. How to clear a console?

    In R studio to clear a console use the command Ctrl + L.

    R STUDIO TABS
  2. How to insert comments in the console?

    Like in Python, we can use the # symbol to comment on a line in R programming.

    R STUDIO TABS
  3. How to do the basic arithmetic operation and display its output?

    As you know, the console is the only place where immediate testing of codes takes place. See the below screenshot where the basic arithmetic operations are accomplished just by providing the operands and operators.

    R STUDIO TABS

You will get your desired output just by hitting the enter button and as simple as that.

Note: To increase the readability, hit enter twice or thrice

2.  The Global Environment

The Global Environment tab plays an important role in R studio because it can be thought of as a workspace where all active objects are displayed. In R Studio, variables and data that we import are saved as objects.

When you declare a variable in the console it will automatically display in the environment tab. 

R STUDIO TABS

In the above example, you have 3 variables namely a, b and c, and each of them is assigned with values 100, 200, and 300 respectively. On the environment tab, you can see the values you have declared. 

Besides these, you can find the History tab which keeps track of all the commands you used so far for your program. See the below screenshot.

R STUDIO TABS

You can see all the operations we have done so far in the history tab. Now suppose you want to remove some of the selected entries from the history, is it possible? Yes , it is. You can use the Red cross button in the toolbar.

R STUDIO TABS

Now to clear the entire history entries, you can use the broom button shown on the toolbar.

R STUDIO TABS

3. The Packages

The next inevitable part in RStudio is the Package tab which lists all the packages that are necessarily needed to run the R programs. Packages are shareable collections of R compiled codes, data, functions, and documentation that are created specifically to perform specific tasks.

R STUDIO TABS

4. The R Script or the Text Editor

Every code you write in R has to be saved in some file for future use. For that, you need to create an R file first by following the steps below as shown in the picture, File -> New File -> R Script. Another option available is by using the shortcut Ctrl+Shift+N.

R STUDIO TABS

This will open you a window with four panes as shown below. The first pane is the text editor where we used to write our codes.

R STUDIO TABS

So now you have acquired some basic knowledge about RStudio and in the next chapter, you will get more enlightenment on how to write your first code in a Text editor and how to run your R code in RStudio, and so on. Chase our upcoming tutorials to upgrade yourself with R.