R Setup in Ubuntu

R is a statistical package to analyze data. I came across this framework while exploring Hortonworks Hadoop Data Platform and want to list down the steps to setup R – Steps on how to use R is not covered here:

1. Open Terminal and Run following commands:
sudo apt-get update
sudo apt-get install r-base
2. Above would install R 2.14.1. To upgrade to latest version, append following to “/etc/apt/sources.list” and run “sudo apt-get update” once again:
deb http://cran.rstudio.com/bin/linux/ubuntu precise/

3. In my Ubuntu, executing above, generated following error:

W: GPG error: http://cran.rstudio.com precise/ Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9

4. To resolve above error, execute following commands:
gpg –keyserver pgpkeys.mit.edu –recv-key 51716619E084DAB9
gpg -a –export 51716619E084DAB9 | sudo apt-key add –
Reference: http://ubuntuforums.org/archive/index.php/t-2154184.html

5. Run following command to upgrade all packages:
sudo apt-get upgrade

Note: To find #packages ubuntu has, use following command – more #packages, more time is taken to upgrade (be ready to do plan for alternative task during this time – upgrade took me 2-3 hours):
dpkg –get-selections | grep -v deinstall > packages.txt

Reference: ubuntuforums.org/archive/index.php/t-2154184.html

6. Run “R” in terminal and we would see R’s console.

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: