> 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] "c:/user/Desktop/" > so that regardless of where the script is, as long as the accompanying > scripts are in the same directory, they can be easily sourced with something > like: > dirX <- file.path.is.here("MasterScript.r") > source(paste(dirX, "AuxillaryFile.r", sep=""))
If you use relative paths like so: # master.r source("AuxillaryFile.r") Then source("path/to/master.r", chdir = T) will work. Mastering working directories is a much better idea than coming up with your own workarounds. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.