码迷,mamicode.com
首页 > 其他好文 > 详细

R on Ubuntu

时间:2014-09-20 21:32:09      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   java   ar   strong   for   sp   cti   

I have been using R recently. R is statistics programming language. R has attracted more and more attention as analytics in cloud gets more and more hot.

 

Don‘t install R in default ubuntu source which only contains a older version. Update apt source according to http://ftp.ctex.org/mirrors/CRAN/. For example, I added the following line to /etc/apt/source.list

 

deb http://bibs.snu.ac.kr/R/bin/linux/ubuntu jaunty/

 

Follow the instructions from here

  1. sudo gedit /etc/apt/sources.list

    This will open up your sources.list file in gedit, where you can add the following line.

  2. deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ version/

    Replace version/ with whatever version of Ubuntu you are using (eg, precise/oneric/, and so on). If you‘re getting a "Malformed line error", check to see if you have a space between /ubuntu/and version/.

  3. Fetch the secure APT key with gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 or gpg --hkp://keyserver keyserver.ubuntu.com:80 --recv-key E084DAB9.

  4. Feed it to apt-key with gpg -a --export E084DAB9 | sudo apt-key add -

  5. Update your sources and upgrade your installation with sudo apt-get update && sudo apt-get upgrade.

 

Install R

sudo apt-get install r-base-dev

 

Install rJava

sudo R CMD javareconf

sudo R to launch RTerm. Issue install.packages(‘rJava‘, dependencies=TRUE) to install rJava.

(Installation of rJava needs root permission so sudo it is needed. sudo R is also needed whenever you want to use rJava in Rterm)

sudo R to launch RTern whenever rJava library needs to be used.

 

There is another way to install rJava. First run `sudo chmod -R 777 /etc/R`. The do all the operations in the previous text without `sudo`.

 

InstallO Other Packages

Use sudo R to launch RTerm

install.packages(‘RWeka‘, dependencies=TRUE)

install.packages(‘kernlab‘, dependencies=TRUE)

install.packages(‘ISwR‘, dependencies=TRUE)

 

Install dependencies packages:

 

- sudo apt-get install libx11-dev

- sudo apt-get install libglu1-mesa-dev

- sudo apt-get install libgl1-mesa-dev

 

In R console, run

 

install.packages(‘Rcmdr‘, dependencies=TRUE)

 

To install ggplot2 and caret, don‘t use dependencies=TRUE. Otherwise, a lot of dependent packages

will be installed. Installation for some of them may fails since some depends on something outside of

R (some ubuntu pacages).

 

http://yaojingguo.iteye.com/blog/513603

http://stackoverflow.com/questions/10476713/how-to-upgrade-r-in-ubuntu

R on Ubuntu

标签:blog   http   io   java   ar   strong   for   sp   cti   

原文地址:http://www.cnblogs.com/yangzhang/p/3983589.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!