[Rd] RJava

Simon Urbanek simon.urbanek at r-project.org
Mon Sep 6 23:59:21 CEST 2010


On Sep 6, 2010, at 4:10 PM, Leidy Patricia Garzon wrote:

> 
> hello 
> 
> I am having the same problem published in https://stat.ethz.ch/pipermail/r-help/2008-July/167191.html but I haven't seen the solution
> 
> Could some body helpme
> 

Well, if you posted to the correct list (stats-rosuda-devel) you would have increased your chance of getting help considerably.

That "problem" is a bug in the Java program -- the constructor it is using does NOT initialize R but is used to hook into an already running R (please consult the docs: http://rforge.net/org/docs/). That program should read:

            Rengine re=new Rengine(args, false, null);
            re.assign("x", "Peter");

Also note that it is discouraged to use the low-level API. It is preferable for new projects to use the high-level org.rosuda.REngine API instead:

	REngine eng = REngine.engineForClass("org.rosuda.REngine.JRI.JRIEngine");  
	eng.assign("x", "Peter")

It is far more flexible and more safe that he direct API. Also it allows you to switch to several back-ends.

Cheers,
Simon



More information about the R-devel mailing list