Linux下使用多个不同版本的R

在Linux系统中,RStudio会根据命令`which R`找到的R版本运行。默认情况下,它绑定到通过终端执行时使用的R版本。如果通过系统包管理器安装R(如Debian或Ubuntu上的R),这通常指向`/usr/bin/R`;若从源代码安装,则可能指向`/usr/local/bin/R`。如果找不到R,RStudio会在`/usr/lib64/R/bin`和`/usr/lib/R/bin`目录下查找R脚本。要指定使用哪个R版本,可以设置`RSTUDIO_WHICH_R`环境变量。要在Ubuntu桌面应用菜单启动RStudio时生效该环境变量,需将其添加到`~/.profile`文件。若需运行多个R版本,可在`~/.profile`中创建别名。
摘要由CSDN通过智能技术生成

On Linux, RStudio uses the version of R pointed to by the output of the following command:

which R

The which command performs a search for the R executable using the system PATH. RStudio will therefore by default bind to the same version that is run when R is executed from a terminal.

For versions of R installed by system package managers (e.g. r-base on Debian or Ubuntu) this will be/usr/bin/R. For versions of R installed from source this will typically (but not always) be/usr/local/bin/R.

If RStudio is unable to locate R using which R, it will fall back to scanning explicitly for the R script in the/usr/local/bin and /usr/bin directories.

If you want to override which version of R is used then you can set the RSTUDIO_WHICH_R environment variable to the R executable that you want to run against. For example:<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值