[R] How to run R to generate graphics (jpeg) files dynamically ?

Ko-Kang Kevin Wang ko-kang at xtra.co.nz
Thu Aug 15 05:13:27 CEST 2002


> 
> From: "Helena Shevchuk" <helena_shevchuk at hotmail.com>
> Date: 2002/08/15 Thu PM 12:40:41 GMT+12:00
> To: R-help at stat.math.ethz.ch
> Subject: [R] How to run R to generate graphics (jpeg) files dynamically ?
> 
> 
> Hello.
> I am getting started with R system and I have a question:
> 
> I'd like to use R system to generate some graphics (jpeg) files dynamically 
> from
> command line or perl script (like: > Rgui -input_r_file <file>.r 
> -output_jpeg_file <file>.jpeg)
> 
> 1) How should I invoke R to read the data from external file.
> 2) How should I invoke R to run statements from external *.r file.

Do you want to call the external files within R?  If so:
  source("foo.R")
will do as long as you set the working directory to be the directory with "foo.R". 

If you want to invoke in batch mode, then depending on your platform (from your description on Rgui, I take it you're on Windows), you will do:
  Rcmd BATCH foo.R
it will then run all the commands in foo.R and save the output in foo.Rout.

> 3) How should I invoke R to save processed data as jpeg file.

What do you mean by processed data?  If you meant "graphs", then take a look at:
  ?jpeg
if you mean all the commands and their results, they will be stored (if you run in BATCH mode) in *.Rout, which is plain ASCII file.


-----------------------------------
Ko-Kang Kevin Wang
Statistical Analysis Division Leader
Software Developers' Klub (SDK)
University of Auckland
New Zealand

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