Possible Duplicate:
Getting path of an R script
I am preparing an R-Script to set the working directory I put the following in ffront of all the other commands:
##### Set directory root
# --> Change this to resident folder of script!
setwd('I:/intern/projects/01.ongoing.projects/Data.rep.final/')
The path given in setwd() is the "resident" folder of the script (-> the one where it has been saved).
If I put the script to another folder or if I move the containing folder I have to provide the new path to the script. Is there a better way of doing this? I presume that there is some function like get.saveD() that returns the location of the file, but so far I couldn't find it.
Any suggestions would be highly appreciated.
Best Albrecht