Installing R and JGR in Ubuntu Intrepid

Here’s an update to my previous instructions on getting R set up and working in Ubuntu. These work for Ubuntu Intrepid, but won’t work for Ubuntu Jaunty (due out next month) until you see “jaunty” in this list.

R is a free, open source software package for performing statistical analyses. It is an alternative to commercial tools such as SPSS, SAS, and S. I recommend using the RSeek search engine to search for help and 3rd party libraries.

To install R, open the Terminal console and run these commands:

gpg –keyserver subkeys.pgp.net –recv-key E2A11821

gpg -a –export E2A11821 | sudo apt-key add –

Then open up your apt-get sources list for editing:

sudo gedit /etc/apt/sources.list

Add this line to the bottom of the sources.list file:

deb http://rh-mirror.linux.iastate.edu/CRAN/bin/linux/ubuntu intrepid/

Note the trailing slash at the end of “intrepid/”. Also you can replace “rh-mirror.linux.iastate.edu” with another mirror server of your choice. Save the file and go back to the Terminal.

Now type this in the terminal to update apt-get’s database before you install R:

sudo apt-get update

Install R with this command:

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

Then run “R” to start R, and “q()” to quit it.

To get JGR, the Java GUI interface working (requires you have java installed, see the sun-java6 package), run this on the command line:

sudo R CMD javareconf

Then run “R” and re-install the JavaGD package (because of a bug). Inside R run:

install.packages(“JavaGD”)

Assuming that succeeds, install JGR now too:

install.packages(“JGR”)

All this should be installing under your home folder:

/home/(yourname)/R/i486-pc-linux-gnu-library/2.8/

You can run JGR now with these commands:

library(JGR)

JGR()

In the future, you can run JGR with a single click by going to the folder where the JGR run script was created and dragging that script to your top Ubuntu panel bar:

/home/(yourname)/R/i486-pc-linux-gnu-library/2.8/JGR/scripts/run

Good luck!

Posted in opensource, R, research, ubuntu
One comment on “Installing R and JGR in Ubuntu Intrepid
  1. Anonymous says:

    A tip to installers- make sure you have the sun-java6-jdk or equivalent package beforehand, for JavaGD to install correctly.Great guide, thanks a bunch!

Comments are closed.

Archives

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 4,340 other followers

%d bloggers like this: