[R] Producing png plot in batch mode

Marc Schwartz (via MN) mschwartz at mn.rr.com
Fri Jun 23 18:29:14 CEST 2006


On Fri, 2006-06-23 at 17:23 +0100, Vittorio wrote:
> I have set up an R procedure that is launched every three hours by 
> crontab in a unix server. Crontab runs at regular intervals the 
> following line:
> R CMD BATH myprog.R
> 
> myprog.R (which by the way uses 
> R2HTML) should create an updated png graph  to be referred to and seen 
> in an intranet web-page index.html.
> 
> The problem is that both:
> 
> png
> (....) 
> plot(...) 
> dev.off() 
> 
> AND:
> 
> plot(...)
> HTMLplot(...)
> 
> fail when 
> launched in a batch manner compalining that they need an X11() instance 
> to be used (I understand that they work only in a graphic context and 
> intarictively).
> 
> How can I obtain that png file? 

See R FAQ 7.19 How do I produce PNG graphics in batch mode?

HTH,

Marc Schwartz



More information about the R-help mailing list