I'm not sure this will solve the issue because if I move the script, I would
still have to go into the script and edit the /path/to/my/script.r, or do
I misunderstand your workaround?
I'm looking for something like:
file.path.is.here(myscript.r)
and which would return something like:
[1]
in the package R.utils
getAbsolutePath()
or you can do a file.list(.. full.names=TRUE,
recursive=TRUE,pattern=(.R))
the rest will require grep and pulling the file name and directory path
apart
If its not evident just ask and I'll write something for you.
basically you want a call
See findSourceTraceback() of R.utils, e.g.
library(R.utils);
example(findSourceTraceback);
However, in general I would avoid using the above, because in nearly
all cases there is a better solution which does not rely on knowing
paths, e.g. setting up functions and calling those instead of using
Try this:
PATH - dirname(sys.frame(1)$ofile)
On Wed, Sep 29, 2010 at 5:00 PM, Stu Field s...@colostate.edu wrote:
Hi all,
Forgive me if this question has been addressed, but I was unable to find
anything in the r-help list or in cyberspace. My question is this: is there
a function, or set
Forgive me if this question has been addressed, but I was unable to find
anything in the r-help list or in cyberspace. My question is this: is there a
function, or set of functions, that will enable a script to detect its own
path? I have tried file.path() but that was not what I was
Hadley,
I'm not sure this will solve the issue because if I move the script, I would
still have to go into the script and edit the /path/to/my/script.r, or do I
misunderstand your workaround?
I'm looking for something like:
file.path.is.here(myscript.r)
and which would return something like:
6 matches
Mail list logo