From chuck at sharpsteen.net  Fri Aug 20 18:58:50 2010
From: chuck at sharpsteen.net (Sharpie)
Date: Fri, 20 Aug 2010 09:58:50 -0700 (PDT)
Subject: [Rd] Rserve graphics output [was Re: C or Java code generation]
In-Reply-To: <E19A79C0-2949-46D4-81B2-1B87185785CB@yahoo.com>
References: <AANLkTi=X-NfgGf3czS9t4LwUKBrUne7=1r+BO7soacEM@mail.gmail.com>
	<19565.13345.692185.626415@max.nulle.part>
	<4C6D3A53.5070808@yandex.ru>
	<19565.21908.102685.183781@max.nulle.part>
	<4C6E3DA0.7010005@yandex.ru> <4C6E4049.4090800@dbmail.com>
	<1282316530615-2332606.post@n4.nabble.com>
	<19566.40074.624066.821704@max.nulle.part>
	<3608EC6A-648A-46F6-8D8F-CC74B5AEB9C7@r-project.org>
	<E19A79C0-2949-46D4-81B2-1B87185785CB@yahoo.com>
Message-ID: <1282323530930-2332761.post@n4.nabble.com>



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.



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