[R] SJava Help

A Friend shadowrunner52 at hotmail.com
Sun Jun 13 17:46:19 CEST 2004

R - 1.9.0
SJava - 0.67
Windows 2000

I can get SJava to work just fine in R but I am having trouble getting R to 
work in Java.  I have created a test class that looks like this:

import org.omegahat.R.Java.*;

public class Test {

  public static void main(String[] args) {

    ROmegahatInterpreter interp = new 
ROmegahatInterpreter(ROmegahatInterpreter.fixArgs(args), flase);


The class compiles fine but when I run it I get the following output:

Loading RInterpeter library
R_HOME: R_HOME=C:/Program Files/R/rw1090
RVersion: R_VERSION=1.6.1

Then I get a windows popup error saying:

Fatal error: unable to open the base package

Why does the R version display as 1.6.1?  I traced through the code as well 
as I could and the problem seems to occur when ROmegahatInterpreter calls 
initR(args).  I think this is where it is making a call to R.dll.  By 
default args[0]="JavaR".  Any idea why?

I've checked the message board and haven't found a solution.  Has anyone 
been able to get R to work in Java?  Any help would be appreciated.  Working 
examples would be great.

More information about the R-help mailing list