From simon.urbanek at r-project.org  Mon Sep  6 23:59:21 2010
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 6 Sep 2010 17:59:21 -0400
Subject: [Rd] RJava
In-Reply-To: <SNT112-W217A47BA9B294045CC64E9CD700@phx.gbl>
References: <SNT112-W217A47BA9B294045CC64E9CD700@phx.gbl>
Message-ID: <DE552547-2CFB-4473-860D-9A86BF969F02@r-project.org>


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



[Rd] RJava
Simon Urbanek