[R] SJAVA error

矢野 順子 junko_yano_ at hotmail.com
Tue Jun 8 18:07:21 CEST 2004


Hi

I'm trying to use SJava and I have troubles. 
I try to run examples from "Calling R from Java"
but,I have an error that 
"fatal error: enable to open the base package"

I heard  SJAVA bug,
so,could you  send me your compiled SJava package with the modified 
REmbed.c because 
in Windows i'm not able to recompile!!!

--example
package org.omegahat.R.Java;

public class REvalSample {
	public static void main(String[] args) {
		String[] rargs = { "--slave", "--vanilla" };

		System.out.println("JavaからRをコールするプログラム");

		ROmegahatInterpreter interp =
			new ROmegahatInterpreter(
				ROmegahatInterpreter.fixArgs(rargs),
				false);
		REvaluator e = new REvaluator();

		Object val = e.eval("x <- sin(seq(0, 2*pi, length=30))");
		val = e.eval("x * 2.0");

		if (val != null) {
			double[] objects = (double[]) val;
			for (int i = 0; i < objects.length; i++) {
				System.err.println("(" + i + ") " + objects[i]);
			}
		}
	}
}
---------

Thank you 

------------
Junko Yano
E-mail : junko_yano_ at hotmail.com




More information about the R-help mailing list