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 t
> 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
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
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 li
>
> 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 l
Try this:
PATH <- dirname(sys.frame(1)$ofile)
On Wed, Sep 29, 2010 at 5:00 PM, Stu Field 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 of functions,
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 of functions, that will enable a script to detect its own
path? I have tried file.path() but that was not what I was lo
7 matches
Mail list logo