Install R in centos

Source: Internet
Author: User

The Windows version of R has a direct installation package, which is very convenient to download and install. However, for centos6 and later versions, you cannot directly install R through Yum and need to compile it yourself.

 

1. install various software with Yum before Compilation

(1) install gcc

> yum install gcc

(2) install g ++

> Yum install gcc-C ++ # Otherwise, the error "Configure: Error: C ++ Preprocessor"/lib/CPP "fails sanity check" is reported.

(3) install gfortran

> Yum install gcc-gfortran. # Otherwise, the error "Configure: Error: No f77 compiler found" is reported.

(4) install Readline

> Yum install Readline-devel # Otherwise, the error "-with-Readline = Yes (default) and headers/libs are not available" is reported.

(5) install libxt

> Yum install libxt-devel # Otherwise, the error "Configure: Error:-with-x = Yes (default) and X11 headers/libs are not available" is reported.

 

2. Download the installation package of R

My version is 3.0.2. You can run the following command:

> wget http://cran.rstudio.com/src/base/R-3/R-3.0.2.tar.gz

 

3. decompress the r installation package

> tar -xzvf R-3.0.2.tar.gz

 

4. modify the configuration file

> Cd R-3.0.2>./configure-Prefix =/installation directory-

 

5. Complete Compilation and Installation

If no error is reported (warning does not count), even if it succeeds, you can run the command> make, and then> make install directly. It may take 10 minutes to complete the make process.

 

6. Enter R for testing

Next, you should be able to directly use R in shell to enter R. If not, use VI/etc/profile to modify the path of the Environment Variable path and add: Export Path = $ path: /usr/local/bin. Do not forget source/etc/profile!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.