[R] non-interactive R usage...

Thomas Lumley tlumley at u.washington.edu
Fri Oct 5 16:41:51 CEST 2001


On Fri, 5 Oct 2001, Liaw, Andy wrote:

> I just try the following on Linux (Mandrake7.1) and it works:
>
> file (tryplot.R:
> jpeg("tryplot.jpg")
> plot(rnorm(100))
> dev.off()
>
> From the shell prompt:
> R --no-save < tryplot.R > tryplot.Rout
>
> This generated the JPEG file, and dump the R session text to tryplot.Rout.
>
> If I understand correctly, jpeg() will *not* work with R BATCH, since it
> depends on x11(), and x11() isn't available when run under batch mode.


Also, if you have any degree of control over the browser used you might
want to use png() rather than jpeg(). The jpeg compression algorithm is
optimised for photographs and in many statistical graphs it is relatively
inefficient and introduces annoying artifacts.  Older browsers don't speak
PNG, though.

	-thomas

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