[R] Can read files at the BATCH jobs?

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri May 17 10:25:25 CEST 2002

ken_lee wrote:
> Dear all,
>      I want to run a batch job, but how to get the dynamic file?
>      example:
>          If I have a.R file like
>            a<-function(data.file) {
>                  read.csv(data.file)
>                 ......
>            }
>      I create r.csh in unix like
>   setenv R_HOME /usr/local/lib/R
>    R BATCH --no-save </usr/users/a.R
>   where I can put the data.file?

1) You can specify a complete path for "data.file" in read.csv(), e.g.

2) If you don't want to specify the path, the file must be in your
working directory.
You can set the working directory with setwd() (and get it with
The default working directory is the directory from which you invoked R.

Uwe Ligges
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