How to install R on CentOS 8

R is an open source programming language and free environment, mainly used for statistical analysis and drawing. It is supported by the R Foundation and is mainly used for statistical analysis. It is mainly used by data statistics and analysts to develop statistical software and for data analysis.

This article mainly describes how to install R on CentOS 8.

1. Prerequisites##

Before proceeding with this guide, please make sure you meet the following prerequisites:

2. Install R on CentOS

The R package is not included in the core software source of CentOS 8. We need to install R from the EPEL software source.

To install R on CentOS 8, follow the steps below:

  1. Enable EPEL and PowerTools software sources
sudo dnf install epel-release
sudo dnf config-manager --set-enabled PowerTools
  1. Install R, enter:
sudo yum install R

R is a meta-package that contains all the necessary R components.

  1. Verify the installation process and print the R version:
R --version

At this time, the most stable version of R is 3.6.2:

R version 3.6.2(2019-12-12)--"Dark and Stormy Night"Copyright(C)2019 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu(64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
  1. Libraries and tools that may be used to install R packages:
sudo yum install make gcc gcc-c++ libcurl-devel libxml2-devel openssl-devel texlive-*

that's it! You have successfully installed R on your CentOS system, and you can start using it.

3. Install R package from CRAN##

One of the main reasons for R's popularity is that many software packages are provided through the Comprehensive R Archive Network (CRAN).

If R is installed with Root or sudo, the package will be installed globally and available to all system users. Want to set up a personal library for your user, install the binary package as a normal user.

As an example, we will install a package called stringr, which provides a quick implementation of usual string operations.

Open the R terminal as root:

sudo -i R
R version 3.6.2(2019-12-12)--"Dark and Stormy Night"Copyright(C)2019 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu(64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()'for distribution details.

 Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()'for more information and
' citation()' on how to cite R or R packages in publications.

Type 'demo()'for some demos,'help()'for on-line help, or
' help.start()'for an HTML browser interfaceto help.
Type 'q()' to quit R.>

Enter the following command in the R terminal and execute it.

Install the stringr package:

install.packages("stringr")

You will be asked to choose a CRAN mirror:

Installing package into ‘/usr/lib64/R/library’(as ‘lib’ is unspecified)--- Please select a CRAN mirror for use inthis session ---
Secure CRAN mirrors 

Choose a mirror image closest to your location.

The installation will take some time. Once completed, enter the following command to load the library:

library(stringr)

Next, create a simple string with the command'tutorial':

tutorial <-c("How","to","Install","R","on","CentOS","8")

Running the following function will print out the length of each string:

str_length(tutorial)
[1]3271261

You can find more R packages in CRAN package page, and install them via install.packages().

Four, summary##

We have shown you how to install R on CentOS 8 and how to install R packages.

Recommended Posts

How to install R on CentOS 8
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install R on Ubuntu 20.04
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
R&amp;D: How To Install Python 3 on CentOS 7
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0
How to install and configure Elasticsearch on CentOS 7
How to install Visual Studio Code on CentOS 8
How to install and use Docker on CentOS 7
How to install R on Ubuntu 18.04 [Quick Start]
How to install RPM packages on CentOS Linux
How to install and configure VNC on CentOS 8
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install VirtualBox client extension on CentOS 8