The R & S Interface to Omegahat and Java

Update to version 0.69-0.

This page provides information about the interface between both R and S and Omegahat and Java. It allows R and S users to invoke Java methods and create Java objects from within R commands. It even allows R functions to be used to implement Java interfaces. This connection to Java gives R and S users access to a increasingly popular language and large collection of tools that include

This is a rich environment, allowing access to any Java class and all of its (public) methods. It uses an embedded Omegahat interpreter, and hence provides an interactive Java session. The Omegahat evaluator offers many utilities that simplify using Java and also make it more familiar to R and S users.

The features of this interface and a brief contrast with other types of inter-language and system communication mechanisms is available here (as a PDF file).

This is the first release of the interface as an R package. There is an issue with one of the advanced features of the interface related to synchronizing Java threads accessing the R evaluator. All feedback is extremely welcome.

Earlier versions of this interface have worked with S version 4. Due to some conflicts with C level symbols, there were problems using it with SPlus 5. We aim to have a basic version that works with new releases of SPlus within a few weeks.

The Software

The software is now available as an R package for both Unix and Windows. The Windows version is available in source and binary form.

Download

SourceBinary
UnixSJava_0.69-0.tar.gzOn Request
Windows SJava_0.69-0.tar.gz

Installation

Installation of the different packages on the different operating systems is given in the following table.
UnixWindows
Source
   R INSTALL -c SJava_0.69-0.tar.gz
   cd $RHOME/src/library
   unzip SJava_0.69-0.zip
   cd SJava
   ./configure.win $RHOME 
   cd $RHOME/src/gnuwin32
   make pkg-SJava
BinaryNA
 cd $RHOME/library
 unzip SJavaWin_0.62-8.zip
A simple to test to see that all is working is (from within R)
 library(SJava)
 .JavaInit()
 .Java("java.lang.System", "getProperty", "java.class.path")
 names(.Java("java.lang.System", "getProperties"))

Requirements

Requirements include a run-time Java virtual machine that supports version 1.2 or higher of Java.
For compiling the code on Windows, see the list of tools and a package containing many of these tools strongly recommeded by the developers managing the Windows distribution of R.

Documentation

  • An introductory guide
    This is an initial version of a manual explaining the different features of the interface with some examples.
  • Annotated Examples
    This is a collection of different examples, some of which illustrate the more advanced aspects of the interface including callbacks to R functions, mutable R objects, dynamic compilation of Java classes, etc.

    This currently provides more information about callbacks to R functions and dynamic class compilation in Java than the Howto above.

  • Calling R from Java
    An introduction to the facilities for evaluating R expressions and calling R functions from Java.
  • Documentation for the Java classes
    Useful when generating new Java class to use for S references/proxies and when calling R from Java.
  • The Help Pages for the Functions.
    Individual pages and a single PDF document
  • Frequently Asked Questions
    Gives a list of potential problems regarding installation and usage of the interface and how to solve them
  • Some comparisons between the Java and Tcl/Tk packages.
  • Features of the Interface
    This is a list of the features of the interface and a brief comparison with other inter-application, inter-language and inter-machine interfaces such as CORBA, PVM, RPC, XML, etc.
  • The Internals
    This is a combination of a guide for the package and a technical manual that gives some of the details of how it works.
  • Example Scripts
    A collection of scripts that both illustrate and test some of the important features of the interface.
  • List of potential features and enhancements
    If anyone feels like undertaking any of these, let us know and we will try to assist. The graphics device idea looks like fun.
  • Bugs that have been encountered
    Some of these have been fixed. Others cannot be easily reproduced. If you have any information about them, please submit it or mail the omega-bugs list
  • C Routines
    An initial list (and occassional description) of some of the routines provided in the library that others can use when writing C routines to be used with Java either in R or stand-alone applications. These are useful when adding converter routines that translate objects between R and Java.
  • History of version changes and old distributions
    Access to the older versions (should anyone want them) and a log of the incremental changes between releases.

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Thu Apr 6 09:02:37 PDT 2006