Jan 6, 2005
Dan Higgins - NCEAS

Using R in Kepler - Note: Comments are for the Windows version of R and must be modified for use on other OSs.

There are several examples of using the R system within Kepler in the $KEPLER/workflows/R subdirectory. These examples use the commandLine actor to launch R. For such example to work, R must first be installed on the local system. [See http://www.r-project.org/ or http://cran.stat.ucla.edu/]

The R binary installer is easy to run. It should create an icon on the Windows to launch R. But the command line version of R, which is called 'RTerm.exe' on windows is used by Kepler. This can be found in the rwxxxx/bin directory under the location where R was installed ('xxxx' is the R version; currently, 'rwxxxx' -> rw2001). To avoid putting the entire path into Kepler workflows, you should put the R 'bin' directory into the path environment variable. [Note that RTerm does not currently exist for Macs and Linux systems. Check documentation for how to run R from the command line for those systems.] You can test to see if the setup works by simply entering 'RTerm' in a CommandPrompt DOS window.  

There is also a dll called 'r.dll' in the R bin directory. For Kepler to be able to find this dll, it should be copied to the Windows/System32 directory (or wherever the java.library.path property points to).

R graphics output is returned to Kepler by creating a jpeg image with R and then reading the file within Kepler. Note that this type of image cannot be created on all R systems.