From duncan at wald.ucdavis.edu  Wed Oct  5 19:49:32 2005
From: duncan at wald.ucdavis.edu (Duncan Temple Lang)
Date: Wed, 05 Oct 2005 10:49:32 -0700
Subject: [Rd] Fwd:  R and Java
In-Reply-To: <200510051408.49503.jourdren@gmail.com>
References: <3b67376c0510041753g1ec0f3c7jef9ce735731e5d81@mail.gmail.com>	<73dae3060510050448x3aaad2dfi8bf324cf00495597@mail.gmail.com>
	<200510051408.49503.jourdren@gmail.com>
Message-ID: <4344122C.4040905@wald.ucdavis.edu>

Laurent Jourdren wrote:
>>I am a grad student and am working on a project where i need to integrate
>>java and R. I have a front end in java and i need to call R functions and
>>be able to dispaly the plots and graphs produced by R on my java front end.
>>I came across some tools like SJava and rserve...but am not sure which best
>>suits my application. Your suggestion will be really helpful.
> 
> 
> 
> 	The only valuable choice to integrate java and R is rserve.
> 
> 	With RSjava,  data don't persist between 2 two commands, so you can't set a 
> variable in R from java in one instruction and re-use this data in the next 
> instruction.

Unfortunately, this is simply not correct.
Objects don't persist in the global namespace between commands.
The computational model does not use R variables in the
global environment because that is well-established as a poor
approach to software engineering and programming.
Unfortunately it is the approach most inter-system interfaces
have taken and that many users expect.
SJava has a much more flexible computational model
that allows the use of references in the local
language to objects in the foreign system.
And this allows one, for example, to pass R functions as Java
methods, e.g for use in an optimizer implemented in Java
but the function to be optimized being written in R.

Rserve has a different, more traditional computational model
for distributed computing.

> 
> 	Rserve is an client/server library, client is pure java (you can easily 
> deploy it  on *nix and Windows) and each connection has its own object space 
> in R (only under *nix).
> 
> 	Laurent.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Fwd: R and Java
Duncan Temple Lang