R on Ubuntu

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.