How to Install R on CentOS 8

Table of Contents

How to Install R on CentOS 8

 

 

 

 

For statistical computations and graphics, this is a free and open-source programming language and software environment. There are many things you can do with R, such as storing data, analyzing data, and creating statistical models. In the development of statistical software and data analysis, statisticians and data miners rely on it. In addition, R’s Core Team and the R Foundation for Statistical Computing provide support.

 

 

 

 

The purpose of this tutorial is to take you through the process of installing R on CentOS 8.

 

 

 

 

 

 

Step 1: Configure VPSie cloud server

 

 

  1. Sign in to your system or register a newly created one by logging in to your VPSie account. 
  2. Connect by SSH using the credentials we emailed you.
  3. Once you have logged into your RedHat instance and update your system.

 

 

 

Check if the box needs any updates,

 

 

# sudo yum updateinfo

 

 

Run the command if it is available,

 

 

# sudo dnf update

 

 

 

 

 

 

Step 2: Installing R

 

 

 

 

 

 

There are no R packages by default in the CentOS repositories. This will be installed through the EPEL repository.

 

 

 

# sudo yum install epel-release

 

 

 

Run the following command to install R,

 

 

# sudo yum install R

 

 

 

Run the following command to verify the installation,

 

 

# R --version

 

 

 

To install the libraries required by R packages, Run below command,

 

 

 

# sudo yum install make gcc gcc-c++ libcurl-devel libxml2-devel openssl-devel texlive-*

 

 

 

 

Now that R has been successfully installed on your CentOS system.

 

 

 

 

 

 

 

Step 3: Obtain R packages from CRAN

 

 

 

 

 

CRAN, the Comprehensive R Archive Network (CRAN), offers a large number of packages for R. This makes it a popular choice.

 

 

 

 

 

As root, open the R console:

 

 

# sudo -i R

 

 

Enter the following command to install stringr,

 

 

# install.packages("stringr")

 

 

 

Choose the nearest mirror to your location. After the installation is complete, load the library by using,

 

 

 

# library(stringr)

 

 

 

 

As a first step, let’s create a simple vector called “test“.

 

 

 

# test <- c("Hello", "world")

 

 

 

 

 

That’s it. The installation of R on CentOS 8 was a simple process. Thanks for reading, that’s all for now! I hope it was informative. 

 

 

 

 

 

 

 

Try VPSie for free today!

Share on
Facebook
Twitter
LinkedIn
Print