[R] display env variable

dstierman dstierman at micron.com
Wed May 1 18:39:57 CEST 2002


I had the same problem with trying to run R from a cgi script on the web.
The only way I got it to work was to set the DISPLAY variable to the server
itself. That way the cgi script had permission to do that because it was
using the server web user account on the server. So I added the following to
the cgi script:
setenv DISPLAY servername:0
This also works for crontab jobs that don't have a display set.
Don

-----Original Message-----
> From: Simon Cawley [mailto:simon_cawley at affymetrix.com]
> Sent: Tuesday, April 30, 2002 1:51 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] generating graphical output when DISPLAY is not set?
>
>
>
> Is it possible to generate graphical output (to a file) when the
> DISPLAY environment variable is not set?  Here's the problem:
>
>   $ unset DISPLAY
>   $ R
>   > png("foo.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`'
>
> I want to have a process running on a server call R to generate graphical
> output, and the problem is that I'm not guaranteed to have a valid
> DISPLAY set.  I have some clumsy workarounds, but it would be cleaner if
> if I had some way to have R not require the DISPLAY.
>
> Thanks,
>
> -Simon

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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