[R] Trouble with R and cronjobs

j_turner@ihug.co.nz j_turner at ihug.co.nz
Wed Apr 3 04:53:05 CEST 2002

<dstierman <dstierman at micron.com> on April 3 said...>
> It appears that my DISPLAY environmental variable is not
> set. Is that necessary, even when the output of the plot command is to a png
> file?

Yes.  And No.

A running X server is absolutely necessary for the png() command.  If X isn't 
running, you get no png().  No jpeg(), either, for that matter.  help(png) 
These devices [png, jpeg] effectively plot on a hidden screen and then copy
the image to the required format.
In other words, they do their own (hidden) X11 plot, then convert that to a 
jpeg or png image.  However...

> Can someone tell me how to fix this?

1) have X running all the time (yuck).
2) install ghostscript (if you don't have it already), and use 

bitmap(file="foo.png", type="png256",res=300)

If it *must* be png format, I'd pick 2. For quality plots over web services, 
you really can't beat the pdf() driver, though.  Yum.  



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