[R] Run function in BATCH mode?
ligges at statistik.uni-dortmund.de
Tue Aug 24 13:10:41 CEST 2004
purmann at mi.fu-berlin.de wrote:
> I am working on a shell script where i need to start a R function defined in a
> script. I know how to run the script; with
> R CMD BATCH script
> which would be equal to
> source("script") in R.
> But how do I run a function(param) of that script in the BATCH mode?
> Thanks in advance.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Say you have a function MyFoo defined in foo.R then you create a file
call.R that sources foo.r (source("foo.R")) and calls your function by,
e.g., MyFoo(a, b, x).
Then just say "R CMD BATCH call.R" ...
More information about the R-help