R/C2/Installing-R-and-RStudio-on-Linux/English
Title of the script: Installing R and RStudio on Linux
Author: Sudhakar Kumar (IIT Bombay)
Keywords: R, RStudio, Linux, Ubuntu 16.04, Packages, ggplot2, dplyr, video tutorial
Visual Cue’’’ | Narration’’’ |
Show slide
Opening Slide |
Welcome to this tutorial on Installing R and RStudio on Linux. |
Show slide
Learning Objective
|
In this tutorial, we will learn how to:
|
Show slideSystem Specifications | To install R and RStudio, I am using,
|
We will install R using the Terminal. | |
Highlight Terminal on the machine | Press Ctrl + Alt + T keys together to open the Terminal on your computer.
|
[Terminal]
sudo apt-get install r-base |
In the Terminal prompt, type the following command and press Enter. |
Cursor on the Terminal.
|
The machine will ask for the system password.
|
Highlight the running commands in the Terminal
|
The installation for R begins.
|
Cursor on the Terminal. | We will wait until the installation is complete. |
Highlight processing triggers statements in the Terminal | R is now installed on our machine. |
Cursor on the Terminal. | I will clear the Terminal before moving further.
|
Let us check if the installation of R is successful. | |
[Terminal]
R |
In the Terminal, type capital R and press Enter. |
Highlight R version on the Terminal | R is launched.
|
Highlight > on the Terminal | Here, we can run the commands using the command-line interface.
|
[R Terminal]
exp(1) |
We will compute the value of mathematical constant e. Remember, e is the base of the natural logarithm.
|
Highlight 2.718 in the Terminal | The required value is displayed.
|
Highlight R version in the Terminal | For this, we need to quit the current session of R. |
[R Terminal]
q() |
In the Terminal, type q followed by parentheses and press Enter. |
Highlight Save workspace image? In the Terminal | It asks whether you want to save the workspace image.
|
[Terminal]
clear |
I will clear the Terminal before moving further.
|
Cursor on the terminal. | Now, we will install RStudio version 1.1.463.
|
[Terminal]
sudo apt-get install -y g++ wget |
Let us install the wget utility first.
|
Highlight Setting up wget in the Terminal | wget is now installed on the machine. |
Cursor in the Terminal | I will clear the Terminal before moving further. |
[Terminal]
cd |
We will change the working directory to home.
|
[Terminal] | In the Terminal, type the following command and press Enter.
|
Highlight rstudio-1.1.463-amd64.deb saved in the Terminal | The deb file has been downloaded. |
[Terminal]
clear |
I will clear the Terminal again. |
Cursor on the terminal. | Now, we need to install g d e b i utility.
|
[Terminal]
sudo apt-get install -y gdebi-core |
In the Terminal, type the following command and press Enter.
|
Highlight Setting up gdebi-core in the Terminal | gdebi has been installed.
|
[Terminal]
clear |
I will clear the Terminal. |
[Terminal]
sudo gdebi rstudio-1.1.463-amd64.deb |
Now, we will install the deb file for RStudio using g d e b i utility.
|
Highlight Do you want to install the software package? [y/N] in the Terminal | It will ask Do you want to install the software package?
|
Highlight Processing triggers in the Terminal | RStudio has been installed.
|
[Terminal]
clear |
I will clear the Terminal again. |
[Terminal]
rstudio |
Now we will verify whether RStudio has been installed successfully.
|
Highlight RStudio window | RStudio is launched. |
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 now 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
|
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.
|
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.
|
[RStudio]
install.packages("MASS") |
Now, we will install another package named as MASS.
|
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.
|
[RStudio]
install.packages("ggplot2") |
Now, we will install ggplot2 Package.
|
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.
|
[RStudio]
install.packages("dplyr") |
Now, we will install dplyr package.
|
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,
|
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
|
Do you have questions in THIS Spoken Tutorial?
Choose the minute and second where you have the question. Explain your question briefly. Someone from the FOSSEE team will answer them. Please visit this site. |
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.
For more details, please visit these sites. |
Show Slide
Acknowledgement |
The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India |
Show Slide
Thank You |
This is Sudhakar Kumar from IIT Bombay signing off. Thanks for watching. |