Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] What file did R read?

BXC (Bendix Carstensen)

2005-02-21


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@(protected)
www.biostat.ku.dk/~bxc

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.