R on Ubuntu

Source: Internet
Author: User

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 yoursources.listFile ingedit, Where you can add the following line.

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

    Replaceversion/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/ubuntu/Andversion/.

  3. Fetch the secure apt keygpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9Orgpg --hkp://keyserver keyserver.ubuntu.com:80 --recv-key E084DAB9.

  4. Feed it to Apt-keygpg -a --export E084DAB9 | sudo apt-key add -

  5. Update your sources and upgrade your installationsudo 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

R (some Ubuntu pacages ).

 

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

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

R on Ubuntu

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.