[R] Plotting to stdout

Gábor Csárdi csardi at rmki.kfki.hu
Fri Aug 28 13:16:12 CEST 2009


On Fri, Aug 28, 2009 at 1:06 PM, Oliver Bandel<oliver at first.in-berlin.de> wrote:
[...]
> The goal was to produce a picture in a web-environment.
>
> At the moment rpy2 will be used.... maybe there are way to achieve something
> like that in this way, but I'm also new to rpy2.
>
> When the graphic could be written to stdout, the calling environment could reead
> it from the forked process.
>
> But maybe rpy2 works different.
>
> Any ideas on that on-the-fly creation of pictures?
> If there would be no temporary files this would be fine.
> That's the reason why I looked for stdout as output channel.

Oliver,

I have a similar problem and had a similar question on the list about
a week ago.... all I could find out that some devices of the Cairo
package are supposed to support plotting to R connections (including
stdout), but it does not work in practice:

> library(Cairo)
> tc <- textConnection("foo", "w")
> CairoPNG(file=tc)
Error in Cairo(width, height, type = "png", file = filename, pointsize
= pointsize,  :
 file must be a filename. to support writing to a connection,
recompile R and Cairo with the R Connection Patch.

Information on the "R connection Patch" is welcome. Recompiling R and
Cairo is not a problem for me, I am putting together a special
environment anyway.

Best,
Gabor

[...]

-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM




More information about the R-help mailing list