[R] What file did R read?

BXC (Bendix Carstensen) bxc at steno.dk
Mon Feb 21 16:38:57 CET 2005


When I run in BATCH mode I use a script (win2000):

c:\stat\r\%R_VERS%\bin\Rcmd BATCH -q --no-restore --no-save %1

Now I want to be able to print the filename of the program, i.e.
the value if the %1 argument, in the .Rout file. 

(Basically I want to write a piece of code in .First() which 
prints date and time and program run, so I need to get to the 
value of %1. Currently I let the operating system print the value 
of %1 to a file, and then read the contents of this file.
Clumsy, it works, but tricky to port to another machine.)

The commandArgs() does NOT capture the name of the input file.

Is it impossible to recover this filename from within R?

Bendix Carstensen
----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc




More information about the R-help mailing list