更改临时目录 [英] Change temporary directory
问题描述
我在 Windows 上使用 R,需要更改存储 tmp 文件的临时目录.
I am using R on windows and need to change the temporary directory where tmp files are stored.
我在这里、R-help 等中检查了一些答案,但没有人在工作.
I checked a few answers, here, in R-help, etc., but no one is working.
Some links I tried: here, here, and here.
在尝试了这些答案之后(我不得不说我没有完全理解它们的要点),tempdir()
仍然是默认值,尽管我尝试了不同的方法.
After trying those answers (I have to say that I do not get exactly the point on them),
tempdir()
still is the default, as much as I try different ways.
任何人都可以给出如何做到这一点的详细示例程序吗?
Can anybody can give a detailed example procedure of how to do this?
我的会话信息:
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.15.2
推荐答案
在 Sys.getenv('R_USER')
给定的目录下创建一个名为 .Renviron 的文件,并用 行保存code>TMP = '
.
Create a file called .Renviron in the directory given by Sys.getenv('R_USER')
and save it with the line TMP = '<your-desired-tempdir>'
.
write("TMP = '<your-desired-tempdir>'", file=file.path(Sys.getenv('R_USER'), '.Renviron'))
这篇关于更改临时目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!