[Rd] Rserve graphics output [was Re: C or Java code generation]

Simon Urbanek simon.urbanek at r-project.org
Fri Aug 20 20:11:07 CEST 2010


On Aug 20, 2010, at 12:58 PM, Sharpie wrote:

> 
> 
> Donald Paul Winston wrote:
>> 
>> Aren't you the guy who created Rserve?
>> 
>> I'd like to develop a web app so clients can perform exploratory data
>> analysis with their browser with no installed software, not even java (I
>> don't like applets). I thought R would be excellent for this but I need
>> some issues cleared up before I invest a lot of time working with it. 
>> 
> 
> Well, Simon is the one who create Rserve.  However, if you have questions
> about Rserve it may be best to start a new thread or at least change the
> subject header of your message.

There is now a thread on the stat-rosuda-devel mailing list about that.


>  This discussion was about creating
> stand-alone executables that use R code for deployment on a desktop.  
> 
> 
> Donald Paul Winston wrote:
>> 
>> It appears R insists on directing plot output to a file. Is their a
>> graphics device that keeps the output in memory so it can be returned to
>> my java app as a stream of bytes? If I have to wait for it to write to a
>> "unique file" and then read it back again then I don't think that's going
>> to work. My web app needs to support hundreds of concurrent clients. 
>> 
> 
> As far as I know all R graphics output that does not go to a screen device,
> such as an X window, must be directed to some sort of file.  I am not aware
> of a graphics device that provides output to something other than a screen
> or a file, but there very well may be such a device in existence.
> 
> The functionality you could describe could be implemented by writing a R
> graphics device that forwards the R plotting commands to... well anywhere
> you want, really.  As the author of an R graphics device, I can say the
> trickiest part of such an undertaking will be calculating font metrics so
> that R can properly position text in the graphics.  Everything else is very
> straight-forward.
> 
> I have plans to write a device that forwards the plotting commands to a
> socket connection that allows another program to execute them.

You may have a look at  xGD[1] - it sends all GD commands to a TCP/IP socket (and there is a Java server as an example).

Cheers,
Simon

[1] http://rforge.net/xGD/

>  In my case,
> an Erlang backbone is used to route the results back to web clients using
> websockets.  The idea is to have the plot rendered directly in the client's
> browser using a JavaScript library like RaphealJS.  However, the school year
> is upon me and the project will probably remain on the drawing board until
> next summer.
> 
> 
> Donald Paul Winston wrote:
>> 
>> Is REngine.jar and REngineRserve.jar  all I need in my web app?
>> 
> 
> I can't comment on REngine as I have not used it.
> 
> 
> Donald Paul Winston wrote:
>> 
>> Also, how come their is no shutdown command from the command line for
>> Rserve. I see one in the java client api. Do I have to write my own?
>> 
> 
> I find that on UNIX a SIGTERM, SIGSTOP or SIGKILL signal broadcast using a
> command line utility such as kill does the job.
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://r.789695.n4.nabble.com/C-or-Java-code-generation-tp2330875p2332761.html
> Sent from the R devel mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 



More information about the R-devel mailing list