Skip to content
Back to formatted view

Raw Message

Message-ID: <DE552547-2CFB-4473-860D-9A86BF969F02@r-project.org>
Date: 2010-09-06T21:59:21Z
From: Simon Urbanek
Subject: RJava
In-Reply-To: <SNT112-W217A47BA9B294045CC64E9CD700@phx.gbl>

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