[R] Getting R to emit an image file as a pipe or Base64 stream: Mac OSX 10.3 - R 2.0.1

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Dec 4 18:19:06 CET 2004


"Thuan-Jin Kee" <kee at wehi.EDU.AU> writes:

> That's right,
> 
> Thanks for your replies.
> 
> The reason why I started X11.app first is because Mac OS 10.3.5 doesn't
> launch X on startup, and instead uses its own Aqua/Quartz gui to render
> most windows until you specifically ask for X.
> 
> The issue we're looking at is how to get R to emit the file as base64, or
> to somehow hand me a pipe. Is there a way to redirect the file in jpeg()
> to stdout?

This is really nasty, but on linuxen, you can do things like

bitmap(file="/proc/self/fd/1",type="png256");plot(0);dev.off()

which gives you several screenfulls of junk, the first characters of
which is "PNG"... 

A cleaner way would be if the file argument to bitmap() could be a
connection, but it can't (and it is nontrivial to change).
 
> still hacking.
> 
> Jin Kee

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list