R/C2/Installing-R-and-RStudio-on-Windows/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of the script: Installing R and RStudio on Windows

Author: Madhuri Ganapathi and Sudhakar Kumar (IIT Bombay)

Keywords: R, RStudio, Windows, packages, ggplot2, dplyr, video tutorial

Visual Cue Narration
Show slide

Opening Slide

Welcome to this tutorial on Installing R and RStudio on Windows.
Show slide

Learning Objective

In this tutorial, we will learn how to:
  • Install R version 3.6.1
  • Install RStudio version 1.1.463 on Windows 10
  • Open RStudio interface
  • Install packages
Show Slide

System Specifications

To install R and RStudio, we will use
  • Windows 10
  • A working Internet connection.
Now we will learn how to install R on the Windows 10.
Highlight Firefox on the machine Open an Internet browser. I am using Firefox for browsing.
Highlight the address bar of the firefox browser.

https://www.r-project.org/

In the address bar, type the following address and press Enter.
Highlight Getting Started on the homepage of R Project Under the tab Getting Started, click on Download R link.
Highlight CRAN Mirrors on the webpage A page named CRAN Mirrors opens.
Highlight the mirror 0-Cloud on the webpage

https://cloud.r-project.org/

Under the mirror 0-Cloud, click on the given link.
Highlight The Comprehensive

R Archive Network on the webpage

A new page The Comprehensive R Archive Network opens.
Highlight Download and Install R on the webpage Under the section Download and Install R, click on Download R for Windows.
Highlight R for Windows on the webpage.

Point to the subdirectories.

A new page R for Windows opens.

Under Subdirectories heading we have a list of subdirectories.

Highlight base on the webpage In the subdirectory named as Base, click on the link Install R for the first time.
Highlight R-3.6.1 for Windows on the webpage A new page R-3.6.1 for Windows opens.
Highlight Download R 3.6.1 for Windows on the webpage Click on the link Download R 3.6.1 for Windows.
Point to the dialog box. Click on the Save File button. A Save file dialog box opens. Click on the Save File button.
Highlight the Downloading icon in the upper pane of the browser The exe file is being downloaded.

We will wait until the downloading is complete.

By default, the exe file will be downloaded to the Downloads folder.

Go to Downloads folder The downloading is now complete. We will go to the Downloads folder.
Highlight Downloads folder on the machine. Double click on the downloaded exe file for R 3.6.1.
Highlight User Account Control window on the machine.

Click Yes to continue.

It will open a prompt seeking your permission to begin the installation of R.

Click Yes to continue.

Highlight Select Setup Language window on the machine

Point to English.

Click on the OK button.

Select Setup Language window opens.

By default, the language is set to English.

Click on OK button to continue.

Highlight Setup - R for Windows 6.1 window on the machine

Scroll the License information.

A window with important information opens.

Read the information about the license and click Next button to continue.

Highlight Select Destination Location on the machine.

>> click Next to continue.

Select Destination Location window to install R opens.

We will keep the default location and click Next to continue.

Highlight Select Components on the machine

Point to the default options.

Click Next button to continue.

Select Components window to install R opens.

We will keep the default options.

Click Next button to continue.

Highlight Startup options on the machine

Point to No radio button.

click Next to continue.

Startup options window opens.

We will leave the default option, No as it is.

Then click Next to continue.

Highlight Select Start Menu folder on the machine.

click Next to continue.

Select Start Menu Folder window opens.

We will keep the default options.

Then click Next button to continue.

Highlight Select Additional Tasks on the machine

Click on Create a desktop shortcut the checkbox.

click Next to continue.

Select Additional Tasks window opens.

In the window click on the checkbox for Create a desktop shortcut.

Click Next to continue.

Highlight Installing on the machine We will wait until the installation of R is complete.
Highlight Setup has finished installing R on the machine Completing the R for Windows 3.6.1 Setup Wizard message appears.

The installation of R is now complete.

Click Finish button Click Finish to exit the setup.
Cursor on Windows Desktop. Now, we will verify whether R has been installed successfully.
Highlight both R icons on the Desktop We can see that the shortcuts to launch R have been created on the Desktop

There are two different icons, which refer to 32-bit and 64-bit installations.

Highlight R 64-bit icon Double click on the 64-bit icon.
Highlight Version 3.6.1 (2019-07-05) in the command line interface for R The command line interface for R opens.

We can see that R Version 3.6.1 has been installed.

Here we can run the commands using the command-line interface.

Cursor on the command line interface. Let us perform some mathematical operations using R.

We will compute the value of mathematical constant e.

Remember e is the base of the natural logarithm.

exp(1)

Highlight [1] 2.718282 in the R command line interface

Type exp followed by 1 in parentheses and press Enter.

The required value is displayed.

It means that R has been installed successfully.

q() Now we will proceed to install RStudio.

For this we need to quit the current session of R.

Type q followed by parentheses and press Enter.

Highlight Save workspace image window It asks whether you want to save the workspace image.

As we have nothing to save click No to continue.

Cursor on the Windows Desktop. Now, we will install RStudio version 1.1.463.
Highlight Firefox on the machine Open an Internet browser. I am using Firefox for browsing.
Highlight the address bar of the Google Chrome

https://www.rstudio.com/

Type the following address in the address bar and press Enter.
Point to the page.

Highlight Download RStudio on the webpage

RStudio home page opens.

Click on Download RStudio button.

Highlight Choose your version of RStudio on the webpage A page named Download RStudio opens.
Highlight RStudio Desktop Open Source License on the webpage.

Click on the DOWNLOAD link.

Scroll down and locate the RStudio Desktop Open Source License.

Under this license, click on the DOWNLOAD button.

Highlight Installers for Supported Platforms on the webpage You will be directed to Installers for Supported Platforms section.
Highlight older version of RStudio on the webpage Above this section, click on the link Older versions of RStudio.
Highlight Older Versions of RStudio on the webpage Older Versions of RStudio page opens.
Highlight RStudio Desktop 1.1.463 on the webpage Scroll down and locate the section RStudio Desktop 1.1.463.
Highlight Windows on the webpage Locate the operating system Windows and click on the Installer link next to it.
Point to the dialog box. Click on the Save File button. A Save file dialog box opens. Click on the Save File button.
Highlight the Downloading icon in the upper pane of the browser The exe file for RStudio 1.1.463 is being downloaded.

By default the exe file will be downloaded in the Downloads folder.

We will wait until the downloading is complete.

Go to Downloads folder The downloading is now complete. We will go to the Downloads folder.
Highlight Downloads folder on the machine Double click on the downloaded exe file for RStudio 1.1.463.
Highlight User Account Control window on the machine It will open a prompt seeking your permission to begin the installation of RStudio.

Click Yes to continue.

Highlight RStudio Setup on the machine

Click Next to continue.

Welcome to the RStudio Setup Wizard window to begin the installation opens.

Click Next to continue.

Highlight Choose Install Location on the machine.

Click Next to continue.

Choose Install Location window to install RStudio opens.

We will keep the default location and click Next to continue.

Highlight Choose Start Menu folder on the machine

Click Install to continue.

A Choose Start Menu folder window opens.

We will keep the default options.

Then click Install to continue.

Highlight Installing on the machine We will wait until the installation of RStudio is complete.
Highlight RStudio has been installed on the machine. Completing the RStudio Setup Wizard message opens.

The installation of RStudio is complete.

Click Finish button. Click Finish to close the setup.

Now, we will verify whether RStudio has been installed successfully.

Highlight Search on the machine Go to the Start menu of your computer and search for RStudio.

Once the RStudio appears, click on it.

Highlight RStudio window RStudio is launched.
[RStudio]

Ctrl + L

We will clear the Console before moving further.

Click in the Console window and press Ctrl and L keys together.

Highlight the greater than symbol in the Console window Now, we will run a plot command.
[RStudio]

plot(1:5)

In the Console window, type plot and in parentheses 1:5 and press Enter.
Highlight the plot in the Plots window The required plot is generated.
Highlight Packages in the interface of RStudio In the right lower side of RStudio, click on Packages.
Show slide

Installing Packages

Now, we will install a few packages which will be required later in this series.
Show slide

Installing Packages

We will install
  • plyr
  • MASS
  • ggplot2 and
  • dplyr
[RStudio] Let us switch to RStudio.

Make sure that you are connected to the Internet.

[RStudio]

install.packages("plyr")

In the Console window, type the following command and press Enter.

We will wait until the installation is complete.

Highlight DONE (plyr) in RStudio plyr package is now installed.
Cursor in the Console window of RStudio I will clear the Console before moving further.
[RStudio]

Ctrl + L

Click in the Console window and press Ctrl and L keys together.
[RStudio]

install.packages("MASS")

Now, we will install another package named as MASS.

Type the following command and press Enter.

We will wait until the installation is complete.

Highlight DONE (MASS) in RStudio MASS package is now installed.
Cursor in the Console window of RStudio I will clear the Console window again.
[RStudio]

Ctrl + L

Click in the Console window and press Ctrl and L keys together.
[RStudio]

install.packages("ggplot2")

Now, we will install ggplot2 package.

In the Console window, type the following command and press Enter.

We will wait until the installation is complete.

Depending upon your speed of the Internet, it may take 4 to 5 minutes.

Highlight DONE (ggplot2) in RStudio ggplot2 package is now installed.
Cursor in the Console window of RStudio I will clear the Console window again.
[RStudio]

Ctrl + L

Click in the Console window.

Press Ctrl and L keys together.

[RStudio]

install.packages("dplyr")

Now, we will install dplyr package.

In the Console window, type the following command and press Enter.

We will wait until the installation is complete.

Depending upon the speed of the Internet, it may take 4 to 5 minutes.

Highlight DONE (dplyr) in RStudio dplyr package is now installed.
Let us summarize what we have learnt.
Show slide

Summary

In this tutorial, we have learnt how to,
  • Install R version 3.6.1
  • Install RStudio version 1.1.463 on Windows 10
  • Open RStudio interface
  • Install packages
Show slide

About the Spoken Tutorial Project

The video at the following link summarises the Spoken Tutorial project.

Please download and watch it.

Show slide

Spoken Tutorial Workshops

We conduct workshops using Spoken Tutorials and give certificates.

Please contact us.

Show Slide

Forum to answer questions

Please post your timed queries in this forum.
Show Slide

Forum to answer questions

Do you have any general/technical questions?

Please visit the forum given in the link.

Show Slide

Textbook Companion

The FOSSEE team coordinates coding of solved examples of popular books.

We give honorarium and certificates to those who do this.

For more details, please visit these sites.

Show Slide

Acknowledgment

The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India
Show Slide

Thank You

This tutorial is contributed by Madhuri Ganapathi and Sudhakar Kumar from IIT Bombay. Thank you for watching.

Contributors and Content Editors

Madhurig, Nancyvarkey, Sudhakarst