As far as I know setwd() does not influence where temporay files (TMPDIR, TMP, TEMP) are located - at least not for me on windows vista. As mentioned before setting environment variable should work. Also I carry R on a USB, so I don't want temporary files being written to the PC / laptop where I connect or downloaded packages for that matter. I use a Renviron.site file to make sure files are saved where I want them (Renviron.site sits in the "etc" folder of the R install files).
and contains the following specifications (this works for me but can't guarantee it is good / recommended practice - for example I need to change directory "M" to match where I plug USB in ) and I created the folders specified, I don't know if R will create them if it doesn't find them: HOME=M:/ R_USER=M:/ R_LIBS_USER=M:/myRlib TMPDIR=M:/myRtmp TMP=M:/myRtmp TEMP=M:/myRtmp HTH Darren stephen sefick wrote: > > ?setwd() > I don't have a windows machine to work on, but this should work. > > On Tue, Mar 17, 2009 at 10:14 PM, andrew <andrewjohnro...@gmail.com> > wrote: >> setwd >> >> On Mar 18, 12:42 pm, Jonathan Greenberg <greenb...@ucdavis.edu> wrote: >>> I'm trying to redirect where temporary files go under R to >>> D:\temp\somerandomname from its default (C:\Documents and >>> Settings\username\Temp\somerandomname) -- how do I go about doing this? >>> >>> --j >>> >>> -- >>> >>> Jonathan A. Greenberg, PhD >>> Postdoctoral Scholar >>> Center for Spatial Technologies and Remote Sensing (CSTARS) >>> University of California, Davis >>> One Shields Avenue >>> The Barn, Room 250N >>> Davis, CA 95616 >>> Cell: 415-794-5043 >>> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307 >>> >>> ______________________________________________ >>> r-h...@r-project.org mailing >>> listhttps://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. >> >> ______________________________________________ >> 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. >> > > > > -- > Stephen Sefick > > Let's not spend our time and resources thinking about things that are > so little or so large that all they really do for us is puff us up and > make us feel like gods. We are mammals, and have not exhausted the > annoying little problems of being mammals. > > -K. Mullis > > ______________________________________________ > 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. > > -- View this message in context: http://www.nabble.com/How-do-I-set-the-Windows-temporary-directory-in-R--tp22571428p22578321.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.