我在 JMP 中编写了一个脚本,利用 R 帮助客户从数据集中获取一些特定信息。他们之前从未安装过 R,所以我帮助他们安装了它(我已经安装过几十次了)。如果 JMP 在计算机上找不到 R,我的脚本就会抛出错误(它使用 Throw(rconn = R Connect();,...) 语句)。安装 R 时 JMP 正在运行,我运行了脚本,但找不到 R。我退出 JMP,重新启动它 - 同样的错误。我重新启动了计算机,运行了脚本 - 同样的错误。我卸载了 R,退出 JMP,安装了 R,启动了 JMP - 同样的错误。所以,我想知道的是,我可以通过指定目标来帮助 JMP 找到 R 吗?JMP 支持文件说:
How JMP Finds R
JMP delays loading R until a JSL-based script requires access to it. When JMP needs to load R, it follows the standard steps for finding R on a Windows computer:
1.Look up the environment variable R_HOME.
If the variable exists, load R from the specified directory.
2.If the environment variable R_HOME does not exist, look up the InstallPath value in the Windows registry under the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R
For 32-bit JMP running on a 64-bit machine, the InstallPath value is under the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\R-core\R
If the InstallPath value exists, load R from the specified directory.
3.If the InstallPath value does not exist, an error message states that R could not be found.
我可以指定环境变量 R_HOME 或传递 InstallPath 值吗?
最终解决方案是用户没有计算机的管理权限(因为他们可以安装 R,所以似乎有)。一旦我们卸载 R,请求管理权限并重新安装 R,一切就都正常了。
我会注意到,进一步调查显示注册表项位于 HKEY_LOCAL_USER\.... 而不是 HKEY_LOCAL_MACHINE\...
我不知道为什么这个人的 R 键在那里,而不是我和其他人所在的位置,但我的问题是,我可以简单地指示 JMP 寻找不同的注册表项吗?