reading file names for R batch process
Thomas Lumley wrote:
On Thu, 6 Dec 2001, Sven Garbade wrote:
Prof Brian D Ripley wrote:
On Thu, 6 Dec 2001, Sven Garbade wrote:
Hi all, I've written a function that takes several filenames as arguments, does some calculations and write new files. Now I want to write a shell script (under Linux) that determines the files for the R process and starts R with the filenames as arguments. But how can I commit the filenames to the R process?
via enviroment variables, most easily. Read by Sys.getenv.
Ah, this is very easy and works! Thanks, Sven
I believe you could also use the commandArgs() function.
I've tried this before I wrote to the list. It didn't work for me, but maybe I've missed something: R CMD BATCH *.data myfunc.R, but commandArgs() listed only the R command line switches. By, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._