Skip to content
Prev 131056 / 398506 Next

documenting yoru progress

If what you mean is that you have a file, test.R, of R commands
and you are using source("test.R") and you wish to discover the
name "test.R" without hard coding it in your file, then place this in
test.R:

ofile <- parent.frame(2)$ofile

and ofile will be set to "test.R".  Note that the line shown should not
be within a function or other local environment within the file but
directly at top level.

This is hack which may need to be modified if the internals of the
source command change.
On Dec 2, 2007 6:24 PM, Tom Sgouros <tomfool at as220.org> wrote: