This guide is intended to help users install and configure “R”, a great, free alternative to SPSS. The instructions that I outline here are tailored to Ubuntu 8.04 (Hardy Heron), but can be alternated to fit any Linux distribution.
What is “R”?
This is right from the R homepage:
R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.
R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.
What is JGR?
Unfortunately, R is based on CLI. This is where JGR comes into play. JGR is a GUI interface for the R program. This is from the JGR homepage:
JGR (speak ‘Jaguar’) is a universal and unified Graphical User Interface for R (it actually abbreviates Java Gui for R). JGR was introduced at the useR! meeting in 2004 and there is an introductory article in the Statistical Computing and Graphics Newsletter Vol 16 nr 2 p9-12
We begin by simply installing R, Java, and all dependencies in one command:
sudo apt-get install -y r-base-dev r-recommended sun-java6-jdk
Check the “Do you agree with the DLJ license terms?” and hit “Forward”. Allow the installer to finish before continuing.
Enable support for Java in R:
sudo update-java-alternatives -s java-6-sun
sudo R CMD javareconf
Now, installing JGR:
After entering the above command, a prompt to select the closest mirror will appear:
Select the closest mirror to you and continue by running this command within R:
Run JGR from inside R:
Run JGR from the terminal:
Thank you for using my tutorial. If you thought this was useful, you may want to consider subscribing to my Linux RSS Feed to get updates for more Linux tips and tricks. Don’t forget to comment as well!
This section will be expanded upon as I recieve input from the comments below.
If you get an error message while trying to load the JGR library (or at the end of the “install.packages(‘JGR’) command that looks like, or contains the following:
“installation of package ‘maps’ had non-zero exit status”
“installation of package ‘CarbonEL’ had non-zero exit status”
“installation of package ‘rJava’ had non-zero exit status”
“installation of package ‘JavaGD’ had non-zero exit status”
“installation of package ‘mapproj’ had non-zero exit status”
“installation of package ‘iplots’ had non-zero exit status in”
Then you will need to make sure that (1) you in fact have the package
sun-java6-jdk installed, and (2) you have also run the two commands in the “Enable Java in R” section of this tutorial.
Sources: JGR Installation Guide for Feisty