我的 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
发布评论