Skip to end of metadata
Go to start of metadata

Installing R and additional modules

To install R on the machine where you want to run the scripts, download the installation from one of the sites linked to at the R Project .  If you have any problems installing or running R, then it is a good idea to consult the R FAQ .

Once you have R installed, you can start it either on the command line with the command R or using the appropriate application shortcut, where you should get a shell that looks somewhat like this:

You can then install any additional R modules that you want within the R environment.  For example BioConductor can be installed by typing at the R prompt

which should give something like:

Installing Rserve

Taverna communicates with the R installation using the RServe protocol. Follow the installation instructions for RServe for information on how to install and start the RServe service.

If the machine that is running Rserve is restarted, then you will need to restart Rserve.

Rserve within R

RServe can be installed and started within the R environment.

Note: On a Mac if you get:

Fatal error: you must specify '--save', '--no-save' or '--vanilla'
use:  Rserve(args="--no-save")

Rserve from the command line

Alternatively, Rserve can be started from the command line.

For Unix users:

Download the latest Rserve snapshot from RForge  - it is Rserve_0.6-3.tar.gz as of November 2010.
In the download directory, at the command line enter:

which will cause:

You may need to sudo to a user with permission to install new R source packages

Rserve can then be run from the command line using:

We strongly recommend that you run Rserve as a separate, non-privileged user account ("nobody" in the above) so that if there is a security problem, the R script won't be able to access your files (unless you explicitly expose them) and the script can be easily isolated.

For Windows users

Download the latest Rserve Windows binary from RForge - it is Rserve_0.6-2.zip as of November 2010.

The files in the zip file need to be extracted so that Rserve.exe is in the same directory as R.dll from the R installation. For example, extract the files so that Rserve.exe is in C:\Program Files\R\R-2.12.0\bin\i386   

Rserve can be run from the command line (if you ensure that Rserve.exe is in your path) or you can create a shortcut to it.

The first time that you run Rserve, you may be prompted to allow Rserve access to ports on the machine.  You may also need to alter the firewall settings to allow access to Rserve

Allowing Taverna access to Rserve

If your workflows run R scripts using an Rserve on the same machine where you run Taverna, then there is no extra configuration of Rserve needed.  Taverna can immediately access it.

If you want your workflows to run R scripts on a different machine from where you run Taverna, then you need to configure Rserve to allow access.  A full description of the configuration possibilities can be found on Rforge .

It is very dangerous to allow unauthorized access to an Rserve. For this reason, although auth defaults to disable, always specify it as enabled and specify a password file.

For Unix users, the configuration file for Rserve defaults to /etc/RServ.conf.

For Windows users, the configuration file defaults to being in the R installation directory, for example C:\Program Files\R\R-2.12.0\bin\i386\Rserv.cfg

The configuration file may need to be created. Also, note the lack of "e" in the file names.

You can put the password file anywhere to which Rserve has read access. However, it is a good idea to put it in the same directory as the configuration file e.g. as /etc/RServ.pwd or C:\Program Files\R\R-2.12.0\bin\i386\Rserv.pwd.

Changing the configuration file

Change the configuration file to (replacing <password_file> with where you put the password file)

Specifying the password file

The password file contains a list of Rserve usernames and passwords, with one username and password per line.

The Rserve usernames have no relationship to the users on the machine where the Rserve is running.  If you want to connect to an Rserver as Rserve user "stian", there does not need to be a user "stian" on the Rserve machine.  If there is a user "stian" on the Rserve machine, then connecting via the Rserver as "stian" will not give any R scripts run by the Rserve user any additional access to files.

The Rserve passwords have no relationship to the passwords of users on the machine where the Rserve is running.

It is a good idea to keep the usernames for Rserve different to those of the machine where Rserve is running.  This prevents confusion.

If the same username is used in Rserve and the machine's operating system then make sure that the passwords are different.

A password file will look something like:

This would allow access to Rserve with the username alanw and password frog.

Checking that Rserve can be accessed

To check if you have an Rserve installed and running on a particular machine, you can run the command

For example,

If you have an accessible Rserve, then you should see a response such as:

If you get a connection refused, then the Rserve is not running or cannot be accessed.

Labels
  • None