[R] non-interactive R usage...

Johann Petrak johann at ai.univie.ac.at
Fri Oct 5 18:15:20 CEST 2001


Chris Milkosky wrote:


> Does R give you the capability to run a script (read as non-interactive) that would perform a statistical task, and then send output
> to a file?  For example: read a set of data from a file, generate a JPEG _file_ containing a plot of the data (with some specific
> stat calcs plotted of course), and then exit?
> 
> I do capacity planning and would like to be able to have JPEG plots of real time statistical data appear on web pages, so I'm
> thinking that a CGI can be executed that starts R up, generates a plot, and writes it to a file.  We currently use gnuplot, but with
> all of the statistical needs we have, it is turning out to be less flexible than we had hoped.
> 

There are two questions in there:
   - how to run R non-interactively: look at the BATCH option
     (try the command: 'R BATCH --help')

   - how to store the output of a plot command in a JPG file: this
     is done by using the "jpeg" device instead of the 'x11' device.
     Try 'help(Devices)' and 'help(jpeg)' in R for a start.

Johann




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