2

我已经安装了两个版本的 R(Base-R 和 Microsoft R)。实际上 Microsoft R 版本是默认的,现在我想更改为 Base-R。在 RStudio -> Options 中更改版本非常简单。但是当我选择 Base-R 版本时,我收到以下消息:

“您需要退出并重新打开 RStudio 才能使此更改生效”

然后我按“确定”,RStudio 停止工作。我多次尝试这个。为什么这不起作用?

是将版本更改为 Base-R 的命令吗?因为我不想卸载 Microsoft R。

谢谢!

4

2 回答 2

1

查看 R Studio 的文档,对于 Windows,R Studio 使用系统注册表确定版本,如果您在安装 MRS 并插入这些注册表项时,这可能会导致冲突。尝试重新添加 Open Source R 的注册表项,如下所示

When you run the R installer, there are options (under ‘Select Additional 
Tasks’) to ‘Save version number in registry’ and (for Administrator 
installs) ‘Associate R with .RData files’.

If you tick the first option, the following string entries are added to the 
Windows registry:

HKEY_LOCAL_MACHINE\Software\R-core\R\Current Version contains the version 
number, currently 3.4.0.
HKEY_LOCAL_MACHINE\Software\R-core\R\[version]\InstallPath (where [version] 
is currently 3.4.0) contains the path to the R home directory.
If you do not have administrative privileges on the machine while running 
the installer, then the entries are created under HKEY_CURRENT_USER. The 
same entries are also created under Software\R-core\R32 or Software\R-
core\R64, for 32- and 64-bit R respectively.

If you tick the second option (shown with administrative privileges only) 
(‘Associate R with .RData files’) then entries are created under 
HKEY_CLASSES_ROOT\.RData and HKEY_CLASSES_ROOT\RWorkspace.

After installation you can add the Registry entries by running RSetReg.exe 
in a sub-folder of the bin folder, and remove them by running this with 
argument /U. Note that this requires administrative privileges unless run 
with argument /Personal and neither sets up nor removes the file 
associations.

报告 RStudio 中的错误的标准方法是从这里在他们的支持社区页面上发布一个主题为“错误报告”的帖子

于 2017-05-18T19:16:42.420 回答
0

我认为这个答案应该可以解决您的问题:

无法在 RStudio 中更改 R 的版本

转到 C:\Users\myaccount\AppData\Roaming\RStudio 并删除“desktop.ini.lock”文件。或重命名文件夹

于 2019-03-19T14:00:22.793 回答