简体   繁体   中英

Installing R on Ubuntu

I am a new user of Ubuntu and facing lot problem in fetching R packages from the nearby CRAN repository. I am using Ubuntu v10.04 and R v2.14.1. I am not able to fetch package like twittR, plyR etc. . Can anyone tell me the appropriate steps for it as I have to use this for performing sentiment analysis on twitter data. is it because of old versions of the softwares??

First, get Ubuntu 14.04. What are you doing with 10.04?

Add the public key for the Ubuntu CRAN release:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

Add a nearby CRAN mirror to the deb list by editing the sources.list:

sudo nano /etc/apt/sources.list

In the file, add this line to the end of the file:

deb http://watson.nci.nih.gov/cran_mirror/bin/linux/ubuntu trusty/

This will add the Bethesda NIH R mirror to our ubuntu trusted sources list. Next, we will update apt-get packages:

sudo apt-get update

Finally, install (the updated versions of) Base-R and Dev-R:

sudo apt-get install r-base r-base-dev

To set up a shared library folder, edit .bash_profile and/or .bashrc to set up

R_LIBS_USER='directory_of_your_choice'.

Do make sure to set proper read/write permissions for your users. For more help, go the the AskUbuntu stack exchange .

Your software installation is five years old so you limit yourself to what was available five years ago . For current packages, use a current R on a current OS installation.

I update every six months (usually a month or two after the release) to the then-current Ubuntu version. Works like a charm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM