在Windows R中设置主目录 [英] setting the home directory in windows R

查看:378
本文介绍了在Windows R中设置主目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

更改路径扩展位置(Win 7)

我想在Windows系统上更改 path.expand(〜/)引用的目录。目前,默认情况下是C:/ Users / home / Documents /。如何改变这个?请注意,这与使用 setwd()

I would like to change the directory that path.expand("~/") references on a windows system. Currently this goes to "C:/Users/home/Documents/" by default. How does one change this? Note that this is distinct from the working directory that is set with setwd()

推荐答案

您可以通过向Rprofile.site文件添加一个R_USER变量来更改此值。

You can change this by adding an R_USER variable to your Rprofile.site file.

Sys.setenv(R_USER="/my/desired/path/to/tilde")

这在linux系统上不起作用。请参阅相关问题:如何重新设置波浪号上的path.expand

This does not work on linux systems. See a related question: How to reset path.expand on tilde

这篇关于在Windows R中设置主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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