The R & S - Java Interface Examples

  • DynamicCompile.R
    This shows how one can dynamically compile a Java class that implements a Java interface by defining each of the methods in that interface to be calls to the corresponding R function and exported R object.
  • DynamicButtonCallback.R
    This example illustrates the use of the dynamic compilation mechanism in the canonical example of using an R function as an action listener for a Swing JButton.
  • StatData.R
    Uses the Omegahat class StatDataURL to read the contents of a URL line-by-line and return them as an R character vector.
  • button.R
    Uses an R closure to respond to the user clicking on a Java button, and illustrates the implicit conversion of an R object to a foreign reference and the use of the .sigs argument to convert an R reference to a particular Java class.
  • buttonCallback.R
    Another example of an R function used to respond to a user event from a button click.
  • converters.R
    Illustration of registering and removing a C routine to convert a Java object to an R object.
  • dataFrameView.R
    Illustration of how to use the Omegahat DataFrameViewer class to display (and edit) an R data frame.
  • dataFrameReferenceView
    This is similar to dataFrameView but rather than copying the contents of the R data frame to a corresponding Java class that is self-contained, we send a reference to the R data frame and arrange to have the Java viewer callback to R to get the information such as variable names, number of columns and rows and cell values.
  • file.choose.R
    A simple example of using the .Java and .JavaConstructor functions to allow the user navigate their directories and select a file using the Swing GUI classes.
  • functionConverters.R
    Provides an example of how to register R functions to convert Java objects to R objects when they are returned from .Java .JavaConstructor and .OmegahatExpression() calls.
  • getClass.R
    A very simple illustration of using several inlined .Java calls to compute the super class of an object.
  • mouseMotion.R
    An example of using an R function to respond to mouse movement events on a Swing component and dynamically displaying the X and Y position of the mouse in a Swing label.

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Tue Jul 25 11:38:31 EDT 2000