[R] Looking up the directory a file is located in

Cliff Clive cliffclive at gmail.com
Thu Nov 18 20:14:53 CET 2010


The dirname() function looks very helpful; I hadn't heard of that one before.

I'm still reading up to see how the parent.frame command does what it does;
I didn't realize that the ofile variable might not be around in the future.  

Richard's suggestion -- source("c:/myfullpath/myfile.r", chdir=TRUE) -- is
probably the best; I would still have to update "myfullpath" if I move
myfile.r, but that's not hard to do.

-- 
View this message in context: http://r.789695.n4.nabble.com/Looking-up-the-directory-a-file-is-located-in-tp3047649p3049394.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list