强制 Rstudio 在 linux 上使用特定版本的 R [英] Forcing Rstudio to use a specific version of R on linux

查看:158
本文介绍了强制 Rstudio 在 linux 上使用特定版本的 R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Rstudio(在 linux 上)运行 R 版本 3.3.0,我不知道是什么指示它这样做.我正在使用 VM,其中我的 .bashrc 文件加载 R 3.3.1,其中我还使用以下命令将 RSTUDIO_WHICH_R env' 变量设置为 R 3.3.1:

My Rstudio (on linux) runs R version 3.3.0 and I don't have a clue what's directing it to do so. I'm using a VM, where my .bashrc file loads R 3.3.1 where I also set the RSTUDIO_WHICH_R env' variable to R 3.3.1 using:

export RSTUDIO_WHICH_R=`which R`

我也在 root 的 .bashrc 文件中设置了这两个,但这都不会阻止 Rstudio 使用 3.3.0.

I've also set these two in the .bashrc file of root, but that neither prevents Rstudio from using 3.3.0.

知道如何强制 Rstudio 使用我想要的 R 版本吗?

Any idea how to force Rstudio to use the R version I want?

推荐答案

您的解决方案几乎与 本文档但我担心shell命令扩展在导出时不适用.为了找出答案,echo $RSTUDIO_WHICH_R 返回什么?(经过测试,工作正常).

Your solution is almost as it appears in this documentation, but I worry that the shell command expansion doesn't apply when being exported. To find out, what does echo $RSTUDIO_WHICH_R return? (tested, works fine).

也许尝试执行 which R 并使用该完整路径作为导出变量.

Perhaps try executing which R and using that full path as the exported variable.

更新:从该文档中,

并不是为了让 RStudio 在从 Ubuntu 桌面应用程序菜单(而不是从终端)启动时看到这个环境变量,它必须在 ~/.profile 文件中定义.

Not that in order for RStudio to see this environment variable when launched from the Ubuntu desktop Applications menu (as opposed to from a terminal) it must be defined in the ~/.profile file.

这篇关于强制 Rstudio 在 linux 上使用特定版本的 R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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