Table des matières

Installation of R 2.10

Additional libraries

No additional library is necessary.

Procedure

Installing R

% sudo su
% echo "deb http://www.probability.ca/cran/bin/linux/ubuntu hardy/" >> /etc/apt/sources.list
//
// You also need to uncomment this line in /etc/apt/sources.list:
// deb http://ca.archive.ubuntu.com/ hardy-backports main restricted universe
//
% gpg --keyserver subkeys.pgp.net --recv-key E2A11821
% gpg -a --export E2A11821 | sudo apt-key add -
% exit
% sudo apt-get update
% sudo apt-get install r-base r-base-dev

Installating the Rserve server

% sudo R
//
// You are in the R console to install at system-level:
//
>install.packages("Rserve")
//
// It will ask for a mirror selection; take one close from home.
//
>q()
% sudo nano /etc/Rserve.conf
workdir /tmp/Rserv
pwdfile 
remote disable
auth disable
plaintext disable
fileio enable
 
port <port>
maxinbuf 262144
 
maxsendbuf 0
uid 48
 
chroot 
sockmode 0
umask 0
 
encoding utf8
% sudo nano /etc/init.d/rserve
#! /bin/sh
# chkconfig: 2345 99 01
# description: Rserve, /etc/init.d/rserve
 
case "$1" in
     start)
	echo -n "Starting Rserve daemon: "
	R CMD Rserve >/dev/null 2>&1
	echo "\t\t[STARTED]"
	;;
     stop)
	echo -n "Stopping Rserve daemon: "
	killall -s 9 Rserve
	echo "\t\t[STOPPED]"
	;;
     restart)
         echo -n "Stopping Rserve daemon: "
         killall -s 9 Rserve
         echo "\t\t[STOPPED]"
         echo -n "Starting Rserve daemon: "
         R CMD Rserve
         echo "\t\t[STARTED]"
         ;;
     *)
        echo "Usage: /etc/init.d/rserve {start|stop|restart}"
        exit 1
esac
 
exit 0
% sudo chown root:root /etc/init.d/rserve
% sudo chmod ugo+x /etc/init.d/rserve
% sudo update-rc.d rserve defaults

Installation of a R GUI

There are many GUI for R but the one I chose is JGR. To install JGR, simply follow this recipe:

% sudo R javareconf
% sudo R
// We are in the R console at system-level
> install.packages('JGR')
// R will ask for a mirror selection
// Install will proceed simply enough. Give it a try:
> library(JGR)
> JGR()
// You should see a R console popping onto your dekstop
// with buttons, menus and everything else
% sudo xfce4-menueditor /etc/xdg/xfce4/desktop/menu.xml