如何正确设置 R.HOME() 和/或 R_HOME? [英] How can I set R.HOME() and/or R_HOME correctly?

查看:72
本文介绍了如何正确设置 R.HOME() 和/或 R_HOME?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 C:\R\R-3.3.0 中安装了 R.但是:

<代码>>R.home()[1] "C:/R/R-33~1.0">Sys.getenv("R_HOME")[1] "C:/R/R-33~1.0"

我认为两者都应该是 "C:/R/R-3.3.0" 因为我在使用调试器时遇到了很多麻烦:它只是找不到库!>

由于我在 Windows 上,我在文档中阅读了此内容,但没有帮助:

<块引用>

在 Windows 上,R.home() 和 R_HOME 的值切换到 8.3路径元素的简短形式(如果需要,并且 Windows 服务这样做已启用.R_HOME 的值设置为使用正斜杠(因为许多包维护者将它不加引号地传递给 shell,因为'Makefile' 中的示例).

非常感谢帮助,因为我对环境变量的了解很少.

解决方案

感谢 @Morgan 我找到了答案 此处:

短名称"实际上是旧的 DOS 8.3 命名约定,因此所有目录都将是前 6 个字母后跟 ~1 假设只有一个名称匹配

I have my R installed in C:\R\R-3.3.0. But:

> R.home()
[1] "C:/R/R-33~1.0"
> Sys.getenv("R_HOME")
[1] "C:/R/R-33~1.0"

I think both should be "C:/R/R-3.3.0" as I have quite a lot of trouble when using the debugger: It just does not find the libraries!

As I am on Windows, I read this in the documentation, but it did not help:

On Windows the values of R.home() and R_HOME are switched to the 8.3 short form of path elements if required and if the Windows service to do that is enabled. The value of R_HOME is set to use forward slashes (since many package maintainers pass it unquoted to shells, for example in ‘Makefile’s).

Help is higly appreciated, because my knowledge about environment variables is tiny.

解决方案

Thanks to @Morgan I found the answer here:

The "short name" is really the old DOS 8.3 naming convention, so all the directories will be the first 6 letters followed by ~1 assuming there is only one name that matches

这篇关于如何正确设置 R.HOME() 和/或 R_HOME?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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