How do I set the Windows temporary directory in R?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I set the Windows temporary directory in R?

Jonathan Greenberg
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: [hidden email], Gchat: jgrn307

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How do I set the Windows temporary directory in R?

AndrewRoyal
setwd

On Mar 18, 12:42 pm, Jonathan Greenberg <[hidden email]> 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: [hidden email], Gchat: jgrn307
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How do I set the Windows temporary directory in R?

ssefick
?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 <[hidden email]> wrote:

> setwd
>
> On Mar 18, 12:42 pm, Jonathan Greenberg <[hidden email]> 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: [hidden email], Gchat: jgrn307
>>
>> ______________________________________________
>> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How do I set the Windows temporary directory in R?

Steven McKinney
In reply to this post by Jonathan Greenberg

Check help for tempfile() and tempdir()

You can set an environment variable
as discussed in the help
to point to D:\temp

>From ?tempfile:
 
 By default, the filenames will be
 in the directory given by tempdir().
 This will be a subdirectory of the
 temporary directory found by the
 following rule. The environment variables
 TMPDIR, TMP and TEMP are checked in turn
 and the first found which points to a
 writable directory is used: if none
 succeeds ‘/tmp’ is used.

HTH

Steven McKinney, Ph.D.

Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre

email: smckinney +at+ bccrc +dot+ ca

tel: 604-675-8000 x7561

BCCRC
Molecular Oncology
675 West 10th Ave, Floor 4
Vancouver B.C.
V5Z 1L3
Canada




-----Original Message-----
From: [hidden email] on behalf of Jonathan Greenberg
Sent: Tue 3/17/2009 6:42 PM
To: [hidden email]
Subject: [R] How do I set the Windows temporary directory in R?
 
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: [hidden email], Gchat: jgrn307

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How do I set the Windows temporary directory in R?

Darren Norris
In reply to this post by ssefick
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. It may dictate one or another but not all.
As mentioned before setting environment variable should work.
Also I carry R on a USB (no idea how much time and effort has gone into R but am really greatful for such a neat and flexible environment), 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 <andrewjohnroyal@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.