Installing the R language software under Linux

Source: Internet
Author: User


Installation Environment:

CentOS, R3.0.1

1, under the terminal download: #cd/usr/local/

#wget http://mirror.bjtu.edu.cn/cran/src/base/R-3/R-3.0.1.tar.gz (input under terminal)

2. Unzip the file:

#tar-ZXVF r-3.0.1.tar.gz
#cd R-3.0.1

3. installation Files

#yum Install Gcc-gfortran

#yum Install Glibc-headers

#yum Install gcc-c++


#yum Install Readline-devel
#yum Install Libxt-devel

#./configure--enable-r-shlib--prefix=/usr/local/r-3.0.1
#make
#make Install

4. Configure Environment variables

CD to Etc/profile,

Edit a file Vim profile

Join

Export r_home=/usr/local/r-3.0.1

Export path=.: $R _home/bin: $PATH

Save and exit,

And then

#source profile

Restarting the operating system

5. Test: Create script (T.R) can enter #r in current environment
OK, the installation is complete, orCreate an R file under a folder XX.R

Input content

#!/path/to/rscript #第一行
X<-c (#R语言代码)
Y<-c (102,299,301)
MODEL<-LM (y~x)
Summary (model)

6. Test: Execute Script

At the terminal Rscript xx. R #结果直接输出到终端

7. Install R Language Pack

wget http://cran.at.r-project.org/src/contrib/Archive/xlsx/xlsx_0.5.5.tar.gz

The above is an example, if you do not know the package version number, I have a way:

wget http://cran.at.r-project.org/src/contrib/Archive/package name such as the package name is xlsx

Then the folder will download a page is the package Name page, which has the package version number, and then copy the version number you want to re-download

wget http://cran.at.r-project.org/src/contrib/Archive/xlsx/xlsx_0.5.5.tar.gz

Then execute the R CMD INSTALL xlsx_0.5.5.tar.gz in the directory of the downloaded package

Of course, there will be dependencies between the package, indicating that the installation error is generally dependent on the package has not been installed, you can first install the dependent package


Installing the R language software under Linux

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.