[R] running R without X11

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 14 12:47:02 CET 2006


On Tue, 14 Nov 2006, Laurence Darby wrote:

>
>
> Hello,
>
> I'm trying to run R from a webserver, which doesn't have an X server,
> and produce pngs to go on a webpage, is this possible?

Yes, see the help page for png.

> I'm doing it in gnuplot with
>
> gnuplot> set term png
> gnuplot> set output
>
>
> With $DISPLAY unset, I get the following error from R:
>
>> png()
> Error in X11(paste("png::", filename, sep = ""), width, height,
> pointsize,  : unable to start device PNG
> In addition: Warning message:
> unable to open connection to X11 display ''
>
> Is there anyway to remove this dependency on X11?

Please read the help page.  R's png device uses X11 for its fonts.  You 
need fonts from somewhere, and vanilla Unix systems don't come with any 
other sets.  You can use ghostscript or libgdd or other resources for 
other graphics devices.  I normally just use an Xvfb frame buffer (but, 
hint, it defaults to 12bit and you want a 24bit screen).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list