[R] Rserve (Anyone?)

Romain Francois romain.francois at dbmail.com
Fri Aug 20 09:11:40 CEST 2010


Questions about Rserve typically go to this mailing list:
http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel

Le 20/08/10 06:25, Donald Paul Winston a écrit :
> REXP has an asBytes() method. Will this capture the output of an R plot
> function if a proper graphics device is used? It appears R insists on
> sending plot output to a file. Kind of strange since it insists on loading
> all your data into memory before it can do anything.
>
> If so then does anyone know what this would be? I prefer png or jpeg.
>
> Example:
>
> c is an RConnection
>
> REXP r = c.eval("png(......); plot(1:25, cex=2, pch=c(1:25))");
>
> Then I can write the r.asBytes() to an output stream.
>
> (I think I already know the answer to this, just hoping I'm wrong)

"r" will be NULL. Before you do it over Rserve, try to do it in R :

 > x <- plot(1:25, cex=2, pch=c(1:25))
 > x
NULL


What you can do is close the device (calling dev.off()), and then send 
the file accross the wire. Rserve has some methods for file transfer.
For example, see : 
http://romainfrancois.blog.free.fr/index.php?post/2009/08/04/Transfer-files-through-Rserve

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/bzoWrs : Rcpp svn revision 2000
|- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th
`- http://bit.ly/aAyra4 : highlight 0.2-2



More information about the R-help mailing list