change location of temporary files

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

change location of temporary files

Kumar Mainali
I would like to change where R stores the temporary files to my external
hard drive in my iMac. This is important because the temporary files R
creates are huge and I do not have enough available space in my internal
HD. Again, this is for macOS.

This change has to be temporary. Later I need to use the usual location for
temp files in the internal HD.

Thanks in advance,
Kumar Mainali

--
Postdoctoral Associate
Department of Biology
University of Maryland, College Park


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: change location of temporary files

Hasan Diwan-2
Kumar,
tempfile has a dir parameter that you can use to designate the directory
the file will be created in.-- H

On 23 February 2018 at 10:52, Kumar Mainali <[hidden email]> wrote:

> I would like to change where R stores the temporary files to my external
> hard drive in my iMac. This is important because the temporary files R
> creates are huge and I do not have enough available space in my internal
> HD. Again, this is for macOS.
>
> This change has to be temporary. Later I need to use the usual location for
> temp files in the internal HD.
>
> Thanks in advance,
> Kumar Mainali
>
> --
> Postdoctoral Associate
> Department of Biology
> University of Maryland, College Park
> ᐧ
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>



--
OpenPGP:
https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using
http://bit.ly/hd1ScheduleRequest.
Si vous voudrais faire connnaisance, allez a
http://bit.ly/hd1ScheduleRequest.

<https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1>Sent
from my mobile device
Envoye de mon portable

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: change location of temporary files

R help mailing list-2
In reply to this post by Kumar Mainali
Does setting the environment variable TMPDIR, before starting R,
to a directory on a bigger file system help?  On Linux I get

  % mkdir /tmp/RTMP-BILL
  % env TMPDIR=/tmp/RTMP-BILL R --quiet --vanilla
  > tempdir()
  [1] "/tmp/RTMP-BILL/Rtmppgowz4"
  > tempfile()
  [1] "/tmp/RTMP-BILL/Rtmppgowz4/file7ce36ec5cb1e"

I don't know if there is an R-specific environment variable or startup
flag for this.



Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Fri, Feb 23, 2018 at 10:52 AM, Kumar Mainali <[hidden email]> wrote:

> I would like to change where R stores the temporary files to my external
> hard drive in my iMac. This is important because the temporary files R
> creates are huge and I do not have enough available space in my internal
> HD. Again, this is for macOS.
>
> This change has to be temporary. Later I need to use the usual location for
> temp files in the internal HD.
>
> Thanks in advance,
> Kumar Mainali
>
> --
> Postdoctoral Associate
> Department of Biology
> University of Maryland, College Park
> ᐧ
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: change location of temporary files

Henrik Bengtsson-5
On Fri, Feb 23, 2018 at 1:55 PM, William Dunlap via R-help
<[hidden email]> wrote:

> Does setting the environment variable TMPDIR, before starting R,
> to a directory on a bigger file system help?  On Linux I get
>
>   % mkdir /tmp/RTMP-BILL
>   % env TMPDIR=/tmp/RTMP-BILL R --quiet --vanilla
>   > tempdir()
>   [1] "/tmp/RTMP-BILL/Rtmppgowz4"
>   > tempfile()
>   [1] "/tmp/RTMP-BILL/Rtmppgowz4/file7ce36ec5cb1e"
>
> I don't know if there is an R-specific environment variable or startup
> flag for this.

Yes, TMPDIR needs to be set *prior* to launching R in order for R to
acknowledge it.  Although most environment variables can be set in
platform-independent Renviron files which are processed early during
the R startup, TMPDIR is one of the exception - it is simply too late
to set it there because R =needs it very very early on.  So, it needs
to be set as in Bill's example above, or similarly:

export TMPDIR=/tmp/RTMP-BILL

/Henrik

>
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Fri, Feb 23, 2018 at 10:52 AM, Kumar Mainali <[hidden email]> wrote:
>
>> I would like to change where R stores the temporary files to my external
>> hard drive in my iMac. This is important because the temporary files R
>> creates are huge and I do not have enough available space in my internal
>> HD. Again, this is for macOS.
>>
>> This change has to be temporary. Later I need to use the usual location for
>> temp files in the internal HD.
>>
>> Thanks in advance,
>> Kumar Mainali
>>
>> --
>> Postdoctoral Associate
>> Department of Biology
>> University of Maryland, College Park
>> ᐧ
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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 -- To UNSUBSCRIBE and more, see
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: change location of temporary files

Gneuro
In reply to this post by Kumar Mainali
You can set this in script as:

library("unixtools ")
set.tempdir("/home/path_to_dir/temp_dir/")

--
Sanjeev

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Kumar Mainali
Sent: Friday, February 23, 2018 1:53 PM
To: R Help <[hidden email]>
Subject: [R] change location of temporary files

I would like to change where R stores the temporary files to my external hard drive in my iMac. This is important because the temporary files R creates are huge and I do not have enough available space in my internal HD. Again, this is for macOS.

This change has to be temporary. Later I need to use the usual location for temp files in the internal HD.

Thanks in advance,
Kumar Mainali

--
Postdoctoral Associate
Department of Biology
University of Maryland, College Park


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see 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 -- To UNSUBSCRIBE and more, see
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.