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

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

问题描述

可能的重复:
更改路径.扩展位置(Win 7)

我想更改 path.expand("~/") 在 windows 系统上引用的目录.当前,默认情况下会转到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()

推荐答案

您可以通过将 R_USER 变量添加到 Rprofile.site 文件来更改此设置.

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天全站免登陆