Several versions of R version are installed and can be accessed by all users.

Setting up the path and environment:

All required environment variables can be set by loading the R module, to do this issue:

Launching on the front end

R can be launched by entering its name at the command prompt; i.e.:

Please note that this method should not be used apart from for quick tests. Exit the R console by typing.

Running through an interactive shell

The following will launch R interactively via the batch queues.

The <startup_flag> can be --save , --no-save or --vanilla . I have used –vanilla but information on the meaning of these flags can is here. In the above command, is the length of real-time the shell will exist for. e.g. to run R for 6 hours:

This will run R from within the terminal from which it was launched.

Batch Execution

To run R in batch-mode you must first generate a list of commands for R to process in a file, e.g. r.in. You needed to make sure that this file is executable. You can do this by running the command chmod u+x <yourscriptname>.sh. You can check this by running the command ls -la command and the information for that line will contain an x for execute like this -rwxr--r--.

A script must then be created that will request resources from the queuing system and launch the R executable; script runR.sh :

This can be submitted to the queuing system using:

The files for a simple R test example are available to download in this tar file, R.tar.

Installing R packages

Given the large number of R packages available and pace of development, it is preferable that users install the packages they need as opposed to using a centrally provided set of packages.

R 2.15.0 and later

To install package foo , start an R session by entering its name at the command prompt; i.e.:

and then from within R, install the package:

This will install the package and any dependencies that are required. The package should then be accessible from subsequent R interactive sessions and batch jobs.