[R] Path to R script

Erik Iverson eriki at ccbr.umn.edu
Wed May 12 21:36:23 CEST 2010


While not a direct answer to your question, do

?getwd and ?setwd help at all?

Johannes W. Dietrich wrote:
> There is certainly a trivial solution for my question, but I can't find 
> the answer in the documentation.
> 
> I need a platform independent method to obtain the file path of the 
> current R script.
> 
> My working group uses R on several machines with different operating 
> systems including Mac OS X, Windows and Linux, and for obvious reasons 
> the file hierarchies are very different. Therefore, it would be useful 
> to be able to address data files and external procedures relative to the 
> path of the script.
> 
> Thank you for any suggestion,
> 
> J. W. D.



More information about the R-help mailing list