Difference between revisions of "R/C2/Installing-R-and-RStudio-on-Windows/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 23: Line 23:
 
* Open '''RStudio''' interface
 
* Open '''RStudio''' interface
 
* Install packages
 
* Install packages
 
  
 
|-  
 
|-  
Line 48: Line 47:
 
|| Highlight '''CRAN Mirrors''' on the webpage  
 
|| Highlight '''CRAN Mirrors''' on the webpage  
 
|| A page named '''CRAN Mirrors '''opens.
 
|| A page named '''CRAN Mirrors '''opens.
 
  
  
Line 66: Line 64:
 
|-  
 
|-  
 
|| Highlight '''R for Windows''' on the webpage  
 
|| Highlight '''R for Windows''' on the webpage  
 
  
 
Point to the subdirectories.
 
Point to the subdirectories.
 
|| A new page '''R for Windows''' opens.
 
|| A new page '''R for Windows''' opens.
 
  
 
Under '''Subdirectories''' heading we have a list of subdirectories.
 
Under '''Subdirectories''' heading we have a list of subdirectories.
Line 88: Line 84:
 
|| Highlight the '''Downloading icon''' in the upper pane of the browser
 
|| Highlight the '''Downloading icon''' in the upper pane of the browser
 
|| The exe file is being downloaded.  
 
|| The exe file is being downloaded.  
 
  
 
We will wait until the downloading is complete.  
 
We will wait until the downloading is complete.  
  
 
+
By default, the exe file will be downloaded in the '''Downloads''' folder.
By default the exe file will be downloaded in the '''Downloads''' folder.
+
 
+
  
 
The downloading is now complete. We will go to the '''Downloads''' folder.
 
The downloading is now complete. We will go to the '''Downloads''' folder.
Line 102: Line 95:
 
|-  
 
|-  
 
|| Highlight''' User Account Control''' window on the machine.
 
|| Highlight''' User Account Control''' window on the machine.
 
  
 
Click '''Yes''' to continue.
 
Click '''Yes''' to continue.
 
|| It will open a prompt seeking your permission to begin the installation of '''R'''.
 
|| It will open a prompt seeking your permission to begin the installation of '''R'''.
 
  
 
Click '''Yes''' to continue.  
 
Click '''Yes''' to continue.  
Line 113: Line 104:
  
 
Point to English.
 
Point to English.
 
  
 
Click on the '''OK''' button.
 
Click on the '''OK''' button.
Line 119: Line 109:
  
 
By default, the language is set to '''English'''.  
 
By default, the language is set to '''English'''.  
 
  
 
Click on '''OK''' button to continue.  
 
Click on '''OK''' button to continue.  
 
|-  
 
|-  
 
|| Highlight '''Setup - R for Windows 6.1 '''window on the machine  
 
|| Highlight '''Setup - R for Windows 6.1 '''window on the machine  
 
  
 
Scroll the License information.
 
Scroll the License information.
 
|| A window with important information opens.  
 
|| A window with important information opens.  
 
  
 
Read the information about the license and click '''Next''' button to continue.  
 
Read the information about the license and click '''Next''' button to continue.  
 
|-  
 
|-  
 
|| Highlight '''Select Destination Location''' on the machine.
 
|| Highlight '''Select Destination Location''' on the machine.
 
  
 
click '''Next''' to continue.  
 
click '''Next''' to continue.  
 
 
  
 
|| '''Select Destination Location''' window to install '''R '''opens.
 
|| '''Select Destination Location''' window to install '''R '''opens.
 
  
 
We will keep the default location and click '''Next''' to continue.  
 
We will keep the default location and click '''Next''' to continue.  
 
|-  
 
|-  
 
|| Highlight '''Select Components''' on the machine  
 
|| Highlight '''Select Components''' on the machine  
 
  
 
Point to the default options.
 
Point to the default options.
 
  
 
Click '''Next''' button to continue.
 
Click '''Next''' button to continue.
Line 158: Line 139:
 
|-  
 
|-  
 
|| Highlight '''Startup options''' on the machine  
 
|| Highlight '''Startup options''' on the machine  
 
  
 
Point to '''No '''radio button.
 
Point to '''No '''radio button.
Line 164: Line 144:
 
click '''Next''' to continue.  
 
click '''Next''' to continue.  
 
|| '''Startup options''' window opens.  
 
|| '''Startup options''' window opens.  
 
  
 
We will leave the default option, '''No''' as it is.
 
We will leave the default option, '''No''' as it is.
 
  
 
Then click '''Next''' to continue.  
 
Then click '''Next''' to continue.  
 
|-  
 
|-  
 
|| Highlight '''Select Start Menu folder''' on the machine.
 
|| Highlight '''Select Start Menu folder''' on the machine.
 
  
 
click '''Next''' to continue.  
 
click '''Next''' to continue.  
Line 178: Line 155:
  
 
We will keep the default options.
 
We will keep the default options.
 
  
 
Then click '''Next''' to continue.  
 
Then click '''Next''' to continue.  
Line 187: Line 163:
  
 
the checkbox.
 
the checkbox.
 
  
 
click '''Next''' to continue.  
 
click '''Next''' to continue.  
Line 203: Line 178:
  
 
The installation of R is now complete.  
 
The installation of R is now complete.  
 
  
 
Click '''Finish''' to exit the Setup.  
 
Click '''Finish''' to exit the Setup.  
 
  
 
Now, we will verify whether '''R''' has been installed successfully.
 
Now, we will verify whether '''R''' has been installed successfully.
Line 221: Line 194:
 
|| The command line interface for '''R''' opens. We can see that R '''Version 3.6.1''' has been installed.
 
|| 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.
Here we can run the commands using the command line interface.
+
 
+
  
 
Let us perform some mathematical operations using '''R.'''  
 
Let us perform some mathematical operations using '''R.'''  
Line 264: Line 235:
 
|-  
 
|-  
 
|| Highlight '''RStudio Desktop Open Source License '''on the webpage.
 
|| Highlight '''RStudio Desktop Open Source License '''on the webpage.
 
  
 
Click on the '''DOWNLOAD''' link.
 
Click on the '''DOWNLOAD''' link.
Line 303: Line 273:
 
|| Highlight''' User Account Control''' window on the machine
 
|| Highlight''' User Account Control''' window on the machine
 
|| It will open a prompt seeking your permission to begin the installation of '''RStudio'''.
 
|| It will open a prompt seeking your permission to begin the installation of '''RStudio'''.
 
  
 
Click '''Yes''' to continue.  
 
Click '''Yes''' to continue.  
 
|-  
 
|-  
 
|| Highlight '''RStudio Setup''' on the machine
 
|| Highlight '''RStudio Setup''' on the machine
 
  
 
Click '''Next''' to continue.  
 
Click '''Next''' to continue.  
 
|| '''Welcome to the RStudio Setup Wizard''' window to begin the installation opens.  
 
|| '''Welcome to the RStudio Setup Wizard''' window to begin the installation opens.  
 
  
 
Click '''Next''' to continue.  
 
Click '''Next''' to continue.  
Line 319: Line 286:
  
 
Click '''Next''' to continue.  
 
Click '''Next''' to continue.  
 
 
  
 
|| '''Choose Install Location''' window to install '''RStudio''' opens.
 
|| '''Choose Install Location''' window to install '''RStudio''' opens.
Line 327: Line 292:
 
|-  
 
|-  
 
|| Highlight '''Choose Start Menu folder''' on the machine  
 
|| Highlight '''Choose Start Menu folder''' on the machine  
 
 
 
  
 
Click '''Install''' to continue.
 
Click '''Install''' to continue.
Line 342: Line 304:
 
|-  
 
|-  
 
|| Highlight '''RStudio has been installed '''on the machine.
 
|| Highlight '''RStudio has been installed '''on the machine.
 
  
 
Click '''Finish''' to close the setup.  
 
Click '''Finish''' to close the setup.  
 
 
  
 
|| '''Completing the RStudio Setup Wizard''' message opens.
 
|| '''Completing the RStudio Setup Wizard''' message opens.
 
  
 
The installation of '''RStudio''' is complete.  
 
The installation of '''RStudio''' is complete.  
 
  
 
Click '''Finish''' to close the setup.  
 
Click '''Finish''' to close the setup.  
 
  
 
Now, we will verify whether '''RStudio''' has been installed successfully.
 
Now, we will verify whether '''RStudio''' has been installed successfully.
Line 361: Line 317:
 
|| Highlight '''Search''' on the machine  
 
|| Highlight '''Search''' on the machine  
 
|| Go to the '''Start''' menu of your computer and search for '''RStudio'''.  
 
|| Go to the '''Start''' menu of your computer and search for '''RStudio'''.  
 
  
 
Once the '''RStudio''' appears, click on it.  
 
Once the '''RStudio''' appears, click on it.  
Line 400: Line 355:
 
* '''ggplot2''' and  
 
* '''ggplot2''' and  
 
* '''dplyr'''  
 
* '''dplyr'''  
 
  
 
|-  
 
|-  
Line 412: Line 366:
 
'''install.packages("plyr")'''
 
'''install.packages("plyr")'''
 
|| In the '''Console''' window, type the following command and press '''Enter'''.
 
|| In the '''Console''' window, type the following command and press '''Enter'''.
 
  
 
We will wait until the installation is complete.  
 
We will wait until the installation is complete.  
Line 426: Line 379:
 
'''Ctrl + L'''
 
'''Ctrl + L'''
 
|| Click in the '''Console''' window.  
 
|| Click in the '''Console''' window.  
 
  
 
Now, press''' Ctrl & L '''keys together.  
 
Now, press''' Ctrl & L '''keys together.  
Line 434: Line 386:
 
'''install.packages("MASS")'''
 
'''install.packages("MASS")'''
 
|| Now, we will install another package named as '''MASS'''.  
 
|| Now, we will install another package named as '''MASS'''.  
 
  
 
Type the following command and press '''Enter'''.
 
Type the following command and press '''Enter'''.
 
  
 
We will wait until the installation is complete.  
 
We will wait until the installation is complete.  
Line 451: Line 401:
 
'''Ctrl + L'''
 
'''Ctrl + L'''
 
|| Click in the '''Console''' window.  
 
|| Click in the '''Console''' window.  
 
  
 
Press''' Ctrl & L '''keys together.  
 
Press''' Ctrl & L '''keys together.  
Line 459: Line 408:
 
'''install.packages("ggplot2")'''
 
'''install.packages("ggplot2")'''
 
|| Now, we will install '''ggplot2 '''Package.
 
|| Now, we will install '''ggplot2 '''Package.
 
  
 
In the '''Console''' window, type the following command and press '''Enter'''.
 
In the '''Console''' window, type the following command and press '''Enter'''.
 
  
 
We will wait until the installation is complete.  
 
We will wait until the installation is complete.  
 
  
 
Depending upon your speed of the Internet, it may take 4 to 5 minutes.  
 
Depending upon your speed of the Internet, it may take 4 to 5 minutes.  
Line 471: Line 417:
 
|| Highlight '''DONE (ggplot2)''' in '''RStudio'''
 
|| Highlight '''DONE (ggplot2)''' in '''RStudio'''
 
|| '''ggplot2''' package is now installed.  
 
|| '''ggplot2''' package is now installed.  
 
 
  
 
|-  
 
|-  
Line 490: Line 434:
 
'''install.packages("dplyr")'''
 
'''install.packages("dplyr")'''
 
|| Now, we will install '''dplyr '''package.
 
|| Now, we will install '''dplyr '''package.
 
  
 
In the '''Console''' window, type the following command and press '''Enter'''.
 
In the '''Console''' window, type the following command and press '''Enter'''.
 
  
 
We will wait until the installation is complete.  
 
We will wait until the installation is complete.  
 
  
 
Depending upon the speed of the Internet, it may take 4 to 5 minutes.  
 
Depending upon the speed of the Internet, it may take 4 to 5 minutes.  
Line 514: Line 455:
 
* Open '''RStudio''' interface
 
* Open '''RStudio''' interface
 
* Install packages
 
* Install packages
 
  
 
|-  
 
|-  
Line 534: Line 474:
  
 
Forum to answer questions
 
Forum to answer questions
 
 
  
 
|| Please post your timed queries in this forum.
 
|| Please post your timed queries in this forum.
Line 542: Line 480:
  
 
Forum to answer questions
 
Forum to answer questions
|| Do you have any general / technical questions?
+
|| Do you have any general/technical questions?
  
 
Please visit the forum given in the link.
 
Please visit the forum given in the link.
Line 550: Line 488:
 
Textbook Companion
 
Textbook Companion
 
|| The '''FOSSEE '''team coordinates coding of solved examples of popular books.
 
|| The '''FOSSEE '''team coordinates coding of solved examples of popular books.
 
  
 
We give honorarium and certificates to those who do this.
 
We give honorarium and certificates to those who do this.
Line 558: Line 495:
 
|| Show Slide
 
|| Show Slide
  
Acknowledgement
+
Acknowledgment
 
|| The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India
 
|| The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India
 
|-  
 
|-  

Revision as of 23:09, 1 November 2019

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 slideSystem 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.
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 in the 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 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 to exit the Setup.

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.

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 parenthesis 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 parenthesis 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.
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.
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.

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 option as it is.

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.

Click Finish to close the setup.

Completing the RStudio Setup Wizard message opens.

The installation of RStudio is complete.

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.
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
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.

Now, press Ctrl & 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.

Press Ctrl & 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 & 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