[R] Rserve: Accessing Images

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu Aug 30 16:23:33 CEST 2007


Thomas Kaliwe wrote:
> Hi,
> 
> Are there more sophisticated  means to access R-images via Rserve than:
> 
> Rconnection c=new Rconnection("127.0.0.1");
> REXP xp=c.eval("try(png(\"test.png\"))")
> c.voidEval("plot(1:10)");
> c.voidEval("dev.off()");
> is = c.openFile("test.png");
> ...
> 
> maybe something with javaGD?

  I'm getting deja-vu today...

  Firstly, what's 'unsophisticated' about this? You create a plot, you 
create a file, then you can read it. There's an awful lot of 
sophistication going on.

  Secondly, what do you want to do? You aren't very clear. Is this code 
in Java? (I've only used Rserve from my python bindings, and that was 
painful).

  Thirdly, if the server is on the localhost (seems to be) and the 
client has access to the files of the server, then you should be able to 
read the files using the native file-handling capabilities of your 
client language.

  Fourthly, have you considered a tighter R-Java coupling than Rserve?

     http://wiki.openi.org/index.php/RServe_RSJava_Comparison

Barry



More information about the R-help mailing list