Welcome to this tutorial on Installing R and RStudio on Linux.
In this tutorial, we will learn how to:
Install R version 3.4.4
Install RStudio version 1.1.463 on Linux OS
Open RStudio interface
Install packages
To install R and RStudio, I am using,
Ubuntu Linux OS version 16.04.
A working Internet connection.
We will install R using the Terminal.
Press Ctrl + Alt + T keys together to open the Terminal on your computer.
Make sure that you are connected to the Internet.
In the Terminal prompt, type the following command and press Enter.
The machine will ask for the system password.
Type the password and press Enter.
The installation for R begins.
Type Y and press Enter to continue the installation process whenever prompted.
We will wait until the installation is complete.
R is now installed on our machine.
I will clear the Terminal before moving further.
In the Terminal, type clear and press Enter.
Let us check if the installation of R is successful.
In the Terminal, type capital R and press Enter.
R is launched.
In the Terminal, scroll up to know the version of R.
We can see that R version 3.4.4 has been installed.
Let us scroll down.
Here, we can run the commands by 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.
In the Terminal, type exp followed by 1 in parentheses and press Enter.
The required value is displayed.
It means that R has been installed successfully.
Now, we will proceed to install RStudio.
For this, we need to quit the current session of R.
In the Terminal, type q followed by parentheses and press Enter.
It asks whether you want to save the workspace image.
As we have nothing to save, type n and press Enter.
I will clear the Terminal before moving further.
In the Terminal, type clear and press Enter.
Now, we will install RStudio version 1.1.463.
For this, we need to download the corresponding d e b file using the w get command.
Let us install the w get utility first.
In the Terminal, type the following command and press Enter.
We will wait until the installation of w get is complete.
w get is now installed on the machine.
I will clear the Terminal before moving further.
We will change the working directory to Home.
In the Terminal, type cd and press Enter.
Let us download the d e b file for RStudio version 1.1.463.
In the Terminal, type the following command and press Enter.
We will wait until the d e b file has been downloaded.
The d e b file has been downloaded.
I will clear the Terminal again.
Now, we need to install g d e b i utility.
This will allow us to install d e b files on our machine.
In the Terminal, type the following command and press Enter.
We will wait until the installation of g d e b i is complete.
g d e b i has been installed.
I will clear the Terminal.
Now, we will install the d e b file for RStudio using g d e b i utility.
In the Terminal, type the following command and press Enter.
It will ask Do you want to install the software package?
Press y to continue.
We will wait until the installation of RStudio is complete.
RStudio has been installed.
I will clear the Terminal again.
Now we will verify whether RStudio has been installed successfully.
In the Terminal, type rstudio and press Enter.
RStudio is launched.
Now, we will run a plot command.
In the Console window, type plot.
Now in parentheses 1:5 and press Enter.
The required plot is generated.
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.
We will install
p l y r
MASS
ggplot2 and d p l y r
Let us switch to RStudio.
Make sure that you are connected to the Internet.
In the Console window, type the following command and press Enter.
We will wait until the installation is complete.
plyr package is now installed.
I will clear the Console before moving further.
Click in the Console window.
Now, press Ctrl + L keys together.
Now, we will install another package named as MASS.
Type the following command and press Enter.
We will wait until the installation is complete.
MASS package is now installed.
I will clear the Console window again.
Click in the Console window.
Press Ctrl + L keys together.
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.
ggplot2 package is now installed.
I will clear the Console window again.
Click in the Console window.
Press Ctrl + L keys together.
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.
dplyr package is now installed.
Let us summarize what we have learnt.
In this tutorial, we have learnt how to,
Install R version 3.4.4
Install RStudio version 1.1.463 on Linux OS
Open RStudio interface
Install packages
The video at the following link summarises the Spoken Tutorial project.
Please download and watch it.
We conduct workshops using Spoken Tutorials and give certificates.
Please contact us.
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.
Do you have any general/technical questions?
Please visit the forum given in the link.
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.
The Spoken Tutorial project is funded by MHRD, Govt. of India
This is Sudhakar Kumar from IIT Bombay signing off. Thanks for watching.