[R] PNG diver problem

Don MacQueen macq at llnl.gov
Thu Nov 29 02:38:06 CET 2001

My experience agrees with what Peter Dalgaard mentioned.
That is, png() requires an active x11 server (process) to be 
available, and the DISPLAY environment variable set to such a server.

At 10:26 PM +0100 11/28/01, Peter Dalgaard BSA wrote:
>I think it works in Linux too if you explicitly set you DISPLAY
>variable (w/ Sys.putenv()), provided that the display is active and
>you have the permissions to access it when the code runs. Windows has
>no such thing and will not let you do anything without having the
>display open anyway...

At 1:21 PM -0800 11/28/01, Thomas Lumley wrote:
>On Wed, 28 Nov 2001 apjaworski at mmm.com wrote:
>>  Finally, I am still curious why this thing works under Windows.  Was the
>>  png driver rewritten for it?  Does it still depend on the windows device
>>  but it can be invoked in batch mode?
>It's the opposite.  The driver was written under Windows and ported to
>Unix, where it relies on X11 calls.  While it is unusual for free software
>to move from Windows to Unix there are a number of examples in R.
>	-thomas

The phrase "relies on X11 calls" makes me wonder...if the machine has 
x11, then whether or not an X11 server running, the libraries are 
there. So perhaps png() could be made to work even so? Far beyond my 
capability, unfortunately.

I, too, would really appreciate having png() [and jpeg()] available 
without also having to have an x11 server running.

One possibility is Xvfb, which comes with at least one version of 
XFree86. As I understand it, it's intended for just these kinds of 
situations. I believe that "vfb" stands for "virtual frame buffer", 
so that if you have Xvfb running you can point DISPLAY at it and use 
drivers like png() and jpeg() that require a Xserver.

Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list