About this wiki

The following best practices document aims to provide some hints and examples on how to install and configure R on a grid based infrastructure.

About R

  • R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS.
  • To download R, please choose your preferred CRAN mirror.
  • If you have questions about R like how to download and install the software, or what the license terms are, please read the FAQs.

Source Pack

The following source packs are available for download.

Pack File
rpm R-2.14.1-1.el5.x86_64.rpm
rpm libRmath-devel-2.14.1-1.el5.x86_64.rpm
rpm R-devel-2.14.1-1.el5.x86_64.rpm
rpm libRmath-2.14.1-1.el5.x86_64.rpm
rpm R-core-2.14.1-1.el5.x86_64.rpm
rpm xdg-utils-1.0.2-2.el5.noarch.rpm

System requirements

The instructions from this best practice have been tested on a:
  • OS: Scientific Linux SL release 5.4 (Boron)
  • Compiler: any
  • Arch: x86_64

Before to install R, please install from repo the following list of packages:

$ yum install -y tk-devel 
$ yum install -y tetex-latex 
$ yum install -y tcl-devel 
$ yum install -y pcre-devel 
$ yum install -y bzip2-devel 
$ yum install -y texinfo-tex

Create and deploy the SW tar in grid

By using the rpm2cpio command extract the rpm files and create the SW tar-ball to be deployed

rpm2cpio *.rpm | cpio -idmv

$ tree R-2.14.1-1.el5.x86_64 -L 3
R-2.14.1-1.el5.x86_64
|-- etc
|   |-- ld.so.conf.d
|   |   `-- R-x86_64.conf
|   `-- rpm
|       `-- macros.R
`-- usr
    |-- bin
    |   |-- R
    |   |-- Rscript
    |   |-- xdg-desktop-icon
    |   |-- xdg-desktop-menu
    |   |-- xdg-email
    |   |-- xdg-icon-resource
    |   |-- xdg-mime
    |   |-- xdg-open
    |   `-- xdg-screensaver
    |-- include
    |   |-- R
    |   `-- Rmath.h
    |-- lib
    |   `-- rpm
    |-- lib64
    |   |-- R
    |   |-- libRmath.so
    |   `-- pkgconfig
    `-- share
        |-- R
        |-- doc
        |-- info
        |-- man
        `-- texmf

18 directories, 13 files

Testing the R Project for Statistical Computing in grid

This is an example of JDL file that can be used for testing:

$ cat R.jdl 
[
Executable = "/bin/sh";
Arguments = "start_R_macro.sh macro.r";

StdOutput = "std.out";
StdError = "std.err";

InputSandbox = {"start_R_macro.sh","macro.r"};
OutputSandbox = {"std.out", "std.err", "out.ps"};

Requirements   = Member("VO-gridit-prod-R-2.14.1-1-SL5-x86_64-gccany", other.GlueHostApplicationSoftwareRunTimeEnvironment);
]

This is the bash script and the macro sent in InputSandbox with the JDL file:

$ cat start_R_macro.sh 
#!/bin/sh
${VO_GRIDIT_SW_DIR}/R-2.14.1-1.el5.x86_64/usr/bin/R --vanilla < $1 > std.out

$ cat macro.r 
postscript("out.ps")
x<-c(1,2,3,4,5,6,7,8)
y<-c(1,2,3,4,5,6,7,8)
plot(x,y,xlim=range(0:10),ylim=range(0:10),type='b',main="X vs Y")
text(4,6,label="Slope=1")
title("X vs Y")
lines(x,y)
dev.off()
q()

References

The R Project for Statistical Computing

Manual

-- GiuseppeLaRocca - 2012-02-07

Topic attachments
I Attachment Action Size Date Who Comment
PDFpdf out.pdf manage 7.4 K 2012-02-07 - 09:57 GiuseppeLaRocca  
Postscriptps out.ps manage 5.0 K 2012-02-07 - 09:58 GiuseppeLaRocca  
Topic revision: r1 - 2012-02-07 - GiuseppeLaRocca
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback