Hi, Just installed R on a new Windows 7 machine (as admin). I feel quite uncomfortable knowing that the default WD when starting R is:> getwd()[1] "C:/Windows/system32" I guess I did something wrong when installing R... How to change R's default working directory? regards Eryk
Change the "Start in:" property on the shortcut you used to start R with. Right-click on the R icon and click Properties (you may need to right click once, then again if you are using the "pinned" start menu icon in Windows 7). Then when you start R again with that shortcut it will use the directory you choose. I'm not sure if you can control this during the install, but mine is set to use the "Documents" folder in my user account. Cheers, Mike. On Tue, Jan 4, 2011 at 8:35 PM, W Eryk Wolski <wewolski at gmail.com> wrote:> Hi, > > Just installed R on a new Windows 7 machine (as admin). > > > I feel quite uncomfortable knowing that the default WD when starting R is: > >> getwd() > [1] "C:/Windows/system32" > > > > I guess I did something wrong when installing R... How to change R's > default working directory? > > regards > > Eryk > > ______________________________________________ > R-help at 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. >-- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: mdsumner at gmail.com
Hi r-help-bounces at r-project.org napsal dne 04.01.2011 10:35:23:> Hi, > > Just installed R on a new Windows 7 machine (as admin). > > > I feel quite uncomfortable knowing that the default WD when starting Ris:> > > getwd() > [1] "C:/Windows/system32"Something was set incorrectly. I believe that with default setting R shall be somewhere in Program Files directory (but you can install it to any directory without problems). Try to remove it and reinstall if it is in some inconvenient place. There is one file .RData which is used as starting workspace. So make any directory, copy this file to it, start R by double click on it and now the new directory is working directory. Quite useful when working on several projects. Regards Petr> > > > I guess I did something wrong when installing R... How to change R's > default working directory? > > regards > > Eryk > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.