R series – 1: Installing R

2–3 minutes

read

Post overview:

1. Brief history of R
2. Installing R and RStudio
3. Installing packages in R 

Welcome to the R series. The series of blog posts aim to introduce R programming. For my research work, I have been using R for the past five years. I felt it is time to start disseminating my knowledge. 

Brief history of R:

Ross Ihaka and Robert Gentleman designed the R programming language. The language is used for statistical analysis and data mining (1). R is a user-friendly language since the functions are intuitive and easy to grasp for a beginner who does not have any programming knowledge. When I started to learn R, there were around 5000+ packages, and now it has more than 16000 packages. 

Source: Wikipedia

Installing R: 

To install R, one has to visit the Comprehensive Archive R Network (https://cran.r-project.org) and download the installation files based on their operating system. After downloading the software, please double-click the setup/ installation files to install R. If you have followed the instructions and installed R, you can start working with it. However, the console and script files using the base R do not facilitate a user to write code. To help the programmer with coding, we have RStudio. 

Source: Rstudio

Installing RStudio:

RStudio is an Interactive Development Environment that facilitates code writing. RStudio helps the user to — 

  • creating documents with the help of knitr 
  • auto-completes the function or object for the user
  • Data viewing in RStudio is better than in R. In R, the data editor is a pop-up, whereas, in RStudio, it is shown within the script pane (1). 
  • Graphs are shown on the plot pane (4). 
  • The objects in use are shown in the environment pane (3).
  • One can also write code directly in the console pane (2).
Different types of Panes in RStudio IDE

To install RStudio, visit https://www.rstudio.com/products/rstudio/download/

Step 1: Choose the free version of RStudio
Step 2: Download the installation file based
Step 3: Double-click the setup file and follow the instructions to install the IDE

After installation, RStudio will automatically start load R in the environment – you do not have to call it separately.

Installing packages:

Once R and RStudio are ready, you can start installing packages. There are a couple of options to install packages. One can use either RStudio menus to install a package or an R command to install the packages.

RStudio steps:
Open RStudio –> Tools (from the menu) –> Install packages –> Provide the name of the package in the Packages section.

RStudio Dialog box for installing packages

R step:
In the console, use the function install. packages to install a package. For example,

install.packages("dplyr")

If you have reached this point, you know how to install R, RStudio, and packages.

Leave a Reply

Discover more from Balachandar Kaliappan

Subscribe now to keep reading and get access to the full archive.

Continue reading