R

Description and Overview
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. 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.
One of R's strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.
R is an integrated suite of software facilities for data manipulation, calculation and graphical display. It includes
- an effective data handling and storage facility,
- a suite of operators for calculations on arrays, in particular matrices,
- a large, coherent, integrated collection of intermediate tools for data analysis,
- graphical facilities for data analysis and display either on-screen or on hardcopy, and
- a well-developed, simple and effective programming language which includes conditionals, loops, user-defined recursive functions and input and output facilities.
Access
Type the following command to launch R:
%module load R
%R
Using R on NERSC Systems
To run a R script on the Hopper compute nodes you must set the environment variable: CRAY_ROOTFS = DSL. To execute a script on the Hopper compute nodes dedicated to your job you need to use aprun, e.g.,:
#PBS -S /bin/bash
#PBS -N myTest
#PBS -l mppwidth=1,walltime=5:00
#PBS -q interactive
#PBS -V
module load R
cd $PBS_O_WORKDIR
export CRAY_ROOTFS=DSL
aprun -n 1 R CMD BATCH code.R
where code.R could be:
j=1;
imagfilename = paste('myimag', j ,'.pdf',sep='');
pdf(filename=imagfilename, width = 800, height =800)
x=1:10;
plot(x, main='R is fun')
dev.off()
Documentation
Extensive on-line documentation is available. You may subscribe to the one or more of R Mailling lists.
Tutorial
Find a quick R tutorial presented at one of our Nersc User Group Meetings.
Availability
| Package | Platform | Category | Version | Module | Install Date | Date Made Default |
|---|---|---|---|---|---|---|
| R | carver | applications/ visualization | 2.10.1 | R/2.10.1 | 2012-02-29 | |
| R | carver | applications/ visualization | 2.12.0 | R/2.12.0 | 2010-11-09 | 2010-11-09 |
| R | carver | applications/ visualization | 2.12.1 | R/2.12.1 | 2012-02-29 | |
| R | carver | applications/ visualization | 2.13.1 | R/2.13.1 | 2012-02-29 | |
| R | carver | applications/ visualization | 2.14.1 | R/2.14.1 | 2012-02-29 | |
| R | carver | applications/ visualization | 2.15.2 | R/2.15.2 | 2012-11-03 | |
| R | davinci | applications/ math | 2.11.1 | R | 2010-08-10 | 2010-08-10 |
| R | euclid | applications/ visualization | 2.11.0 | R/2.11.0 | 2012-02-29 | |
| R | euclid | applications/ visualization | 2.15.2 | R/2.15.2 | 2012-11-03 | |
| R | genepool | applications/ programming | 2.12.0 | R/2.12.0 | 2012-04-02 | |
| R | genepool | applications/ programming | 2.14.1 | R/2.14.1 | 2012-04-02 | 2012-04-02 |
| R | genepool | applications/ programming | 2.15.0 | R/2.15.0 | 2012-05-14 | 2012-05-14 |
| R | genepool | applications/ programming | 2.15.1 | R/2.15.1 | 2012-07-07 | |
| R | genepool | applications/ programming | 2.15.2 | R/2.15.2 | 2012-11-09 | 2012-12-18 |
| R | genepool | applications/ programming | 2.15.2_1 | R/2.15.2_1 | 2013-01-28 | 2013-01-28 |
| R | genepool | applications/ programming | 2.2.26 | ncbi/2.2.26 | 2012-05-14 | 2012-05-14 |
| R | hopper | applications/ visualization | 2.11.0 | R/2.11.0 | 2011-02-18 | 2011-02-18 |
| R | hopper | applications/ visualization | 2.12.1 | R/2.12.1 | 2011-03-20 | 2011-03-20 |
| R | phoebe | applications/ programming | 2.15.1 | R/2.15.1 | 2012-07-28 | 2012-07-28 |
| R | phoebe | applications/ programming | 2.15.2 | R/2.15.2 | 2012-11-09 | 2012-12-18 |
| R | phoebe | applications/ programming | 2.15.2_1 | R/2.15.2_1 | 2013-01-28 | 2013-01-28 |


