How to get R to recognize your working directory as its working directory?

Posted by Dan Goldstein on Stack Overflow See other posts from Stack Overflow or by Dan Goldstein
Published on 2009-09-08T17:42:57Z Indexed on 2010/03/12 12:07 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

I use R under Windows on several machines.

I know you can set the working directory from within an R script, like this

setwd("C:/Documents and Settings/username/My Documents/x/y/z")

... but then this breaks the portability of the script. It's also annoying to have to reverse all the slashes (since Windows gives you backslashes)

Is there a way to start R in a particular working directory so that you don't need to do this at the script level?

© Stack Overflow or respective owner

Related posts about r

    Related posts about working-directory