更改临时目录 [英] Change temporary directory

查看:35
本文介绍了更改临时目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆