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

Sharpie chuck at sharpsteen.net
Fri Aug 20 18:58:50 CEST 2010



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.  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.  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.



More information about the R-devel mailing list