Change temporary directory

前端 未结 4 651
遥遥无期
遥遥无期 2020-11-27 13:58

I am using R on windows and need to change the temporary directory where tmp files are stored.

I checked a few answers, here, in R-help, etc., but no one is working

4条回答
  •  旧时难觅i
    2020-11-27 14:19

    For Linux, I'm using Ubuntu 18.04.1 LTS. You can try the following line:

    write("TMP = YOUR_PATH_VARIABLE", file=file.path('~/.Renviron'))
    

    Explanation: This line will write the TMP variable, which has been assigned to your own temp path, to the '.Renviron' file. And this '.Renviron' file will be created in your home directory. If this doesn't work, restart your R or R studio. The reason is the temporary directory was created before the current R session. So you have to restart another R session to implement this new TEMP_PATH configuration.

提交回复
热议问题