强制 Rstudio 在 linux 上使用特定版本的 R

编程入门 行业动态 更新时间:2024-10-27 13:31:33
本文介绍了强制 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

本文发布于:2023-05-30 09:21:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/365361.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   Rstudio   linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!