How can a source
d or Sweave
d file find out its own path?
Background:
I work a lot with .R scripts or .Rnw files. My projects are o
I have no direct solution how to obtain the directory of the file itself but if you have a limited range of directories and directory structures you can probably use
if(file.exists("c:/somedir")==TRUE){setwd("c:/somedir")}
You could check out the pattern of the directory in question and then set the dir. Does this help you?