Re: [R] Working directories... Again

2010-02-26 Thread Duncan Murdoch

On 26/02/2010 12:55 PM, Allen L wrote:

Dear R forum,
I've looked many places for this and figure there must be an easy way to
implement.

I want to set the working directory in my script to the place where the R
code is located.
Something like: 
>setwd(directory where this script is found).


If you wrote the script, then you know where you put it, so the simplest 
way is just to hard code the directory at the top of the script.


If you want to be able to move the script around and have it still work, 
that doesn't work.  See the thread in this list entitled "Re: [R] 
relative file path" from about 4 days ago for some dirty methods to 
handle that case.


Duncan Murdoch

__
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.


[R] Working directories... Again

2010-02-26 Thread Allen L

Dear R forum,
I've looked many places for this and figure there must be an easy way to
implement.

I want to set the working directory in my script to the place where the R
code is located.
Something like: 
>setwd(directory where this script is found).

Thanks!
-Allen

-- 
View this message in context: 
http://n4.nabble.com/Working-directories-Again-tp1571058p1571058.html
Sent from the R help mailing list archive at Nabble.com.

__
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.