[R] Command Line Programs

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Mar 5 00:09:52 CET 2004


"Kissell, Robert [EQRE]" <robert.kissell at citigroup.com> writes:

> Right Now I have a function that runs these commands. Also, I can
> easily COPY the commands from some editor (e.g., Word) and PASTE to
> the R Console, and R will automatically run the commands.
> 
> The question is, Is there anyway to invoke a series of commands
> outside of the function? In MatLab, as I mentioned, I would save the
> commands in a script file say TEST.m and run the commands from the
> MatLab command line prompt simply by typing TEST <enter>.
> 
> Thanks in advance.

source("foo.R")   # in R
R CMD BATCH foo.R # from a command line interface
Rcmd BATCH foo.R  # Windows variation of same

Was this really not to be found in any of the documents available to
you?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list