Saturday, June 29, 2013

How to install R, JGR and Deducer in SolydX Linux

A step-by-step guide about how to install the free statistical software GNU R, JGR and Deducer in SolydX Linux (32-bit, version 201306), an Debian (testing?) derivative distribution.

The combination of GNU R, JGR and Deducer is a powerful free alternative to all proprietary / commercially distributed statistical programs like SPSS. Together, they provide a wide variety of statistical and graphical techniques, combined with intuitive graphical menus and dialogues that guide the user efficiently through the data manipulation and analysis process.

To install R, JGR and Deducer in SolydX Linux (possibly in Debian testing and stable versions too), follow the steps described below.

1. Install the most recent R version

To obtain the latest R packages, add in your /etc/apt/sources.list file a repository URL for the Debian Wheezy (stable version of the Debian) archives on CRAN (choose a CRAN Mirror that is geographically close to you). Run in terminal:
sudo editor /etc/apt/sources.list

and add to the end of the file:
deb wheezy-cran3/

Add the secure key for the Debian archives on CRAN (run in terminal):
apt-key adv --keyserver --recv-key 381BA480

Install R (run from terminal):
sudo apt-get update
sudo apt-get install r-base-dev

If your network is behind a proxy/firewall, you can't directly install and update R packages. To solve the problem, you need to add to (one of) /etc/R/ or ~/.Rprofile files the following lines (substituting your own username, password, proxy server and port settings):

Note that the username:password@ part is needed only if the proxy requires authentication.

For me the added lines was:

Putting http_proxy= in ~/.Renviron will work too.

2. (Install Java Development Kit and) enable Java support in R

In SolydX Java Development Kit is preinstalled, but you can read instructions from the post How to install Java / OpenJDK in Ubuntu. After that enable Java support in R (run in terminal):
sudo R CMD javareconf

3. Install JGR, Deducer, DeducerExtras and DeducerRichOutput packages (for other extension packages for Deducer look in the online manual)

Run in terminal:
sudo R --no-save

Run in R environment:
update.packages(ask=FALSE, repos = '')
install.packages(c('JGR', 'Deducer', 'DeducerExtras'), repos = '')
install.packages('DeducerRichOutput', repos = '')
install.packages('XLConnect', repos = '') ## for importing Excel files

4. Add a menu entry for JGR

Run in R environment (started in previous step):

This will create a launcher for JGR.
Close (if) opened JGR window.

Download an icon image for JGR (run in terminal):
sudo wget -O /usr/share/icons/jgr-48x48.jpg

Create a .desktop file for the JGR menu entry. For this run in terminal:
sudo editor /usr/share/applications/jgr.desktop

and copy/paste the bellow content:
[Desktop Entry]
Name=JGR - Java Gui for R
Comment=Java Gui for R

Save created file with Ctrl+X.

5. Set JGR to auto-load Deducer, DeducerExtras and DeducerRichOutput packages

Start JGR from your account (Applications > Science > JGR - Java GUI for R), open Packages & Data > Package Manager menu, select load and default next to Deducer, DeducerExtras and DeducerRichOutput, click on Close button.


Post a Comment