Dear helpers, I've looked in the help files (maybe not very thoroughly but I looked) and I couldn't find a straightforward way to permanently set the working directory (where I save and read files). Each time I startup R the working dir is automatically "C:/R/bin" [using:getwd()], and I know I can change it using setwd [for example setwd("C:/R/DATA"), but it's only a transient change for the session, when I close and start a new R session it's in "C:/R/bin" again. How can I set it definitively to "C:/R/DATA" without having to redo it every session? Thanks -- View this message in context: http://www.nabble.com/Permanent-change-to-the-working-directory-tp16761149p16761149.html Sent from the R help mailing list archive at Nabble.com.
If you have an R-icon on the desktop, use the right mouse button and go to "properties". At the "execute in" line insert your data directory "C:/R/DATA". Hope it helps Udo Zitat von francogrex <francogrex at mail.com>:> > Dear helpers, > I've looked in the help files (maybe not very thoroughly but I looked) and I > couldn't find a straightforward way to permanently set the working directory > (where I save and read files). Each time I startup R the working dir is > automatically "C:/R/bin" [using:getwd()], and I know I can change it using > setwd [for example setwd("C:/R/DATA"), but it's only a transient change for > the session, when I close and start a new R session it's in "C:/R/bin" > again. How can I set it definitively to "C:/R/DATA" without having to redo > it every session? Thanks > -- > View this message in context: >http://www.nabble.com/Permanent-change-to-the-working-directory-tp16761149p16761149.html> Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-------------------------------------------- Udo K N G ? I Clinic for Child an Adolescent Psychiatry Philipps University of Marburg / Germany
On windows machines you could change the `Start in' field of the desktop shortcut for R to the desired working directory - you will find this in the properties of the shortcut. You could easily create several shortcuts for different projects this way. You may also consider changing your .Rprofile, see ?.Rprofile hth. francogrex schrieb:> Dear helpers, > I've looked in the help files (maybe not very thoroughly but I looked) and I > couldn't find a straightforward way to permanently set the working directory > (where I save and read files). Each time I startup R the working dir is > automatically "C:/R/bin" [using:getwd()], and I know I can change it using > setwd [for example setwd("C:/R/DATA"), but it's only a transient change for > the session, when I close and start a new R session it's in "C:/R/bin" > again. How can I set it definitively to "C:/R/DATA" without having to redo > it every session? Thanks >-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/42803-8243 F ++49/40/42803-7790
On 4/18/2008 3:15 AM, francogrex wrote:> Dear helpers, > I've looked in the help files (maybe not very thoroughly but I looked) and I > couldn't find a straightforward way to permanently set the working directory > (where I save and read files). Each time I startup R the working dir is > automatically "C:/R/bin" [using:getwd()], and I know I can change it using > setwd [for example setwd("C:/R/DATA"), but it's only a transient change for > the session, when I close and start a new R session it's in "C:/R/bin" > again. How can I set it definitively to "C:/R/DATA" without having to redo > it every session? Thanks?Startup -- Chuck Cleland, Ph.D. NDRI, Inc. (www.ndri.org) 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894