如何为RStudio自定义R位置 [英] How can the R location be customized for RStudio

查看:322
本文介绍了如何为RStudio自定义R位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前使用自制软件安装R和RStudio的软件包安装程序.最近,我开始使用Boxen,它接管了自制酒.我不得不使用自制软件从源代码重新安装R,它现在存在于Boxen Cellar的位置.现在RStudio不再启动,并说无法通过扫描标准位置来定位R二进制文件".我尝试重新安装RStudio(无论如何我都需要升级),但这没有帮助.它的打开时间还不够长,无法让您指定自定义位置.

I previously used homebrew to install R and the package installer for RStudio. Recently I started using Boxen, which takes over homebrew. I had to re-install R from source using homebrew, and it now exists in my Boxen Cellar location. Now RStudio no longer launches, saying "Unable to locate R binary by scanning standard locations". I tried reinstalling RStudio (I needed to upgrade anyway) but that didn't help. It doesn't even open for long enough to let you specify a custom location.

推荐答案

好,我终于知道了.从这篇文章发现您可以将RSTUDIO_WHICH_R设置为自定义位置.在Mountain Lion上,最容易做到的是:

OK I figured it out finally. Discovered from this post that you can set RSTUDIO_WHICH_R to your custom location. On Mountain Lion, this is most easily done with:

对于OS X Mountain Lion 10.8:

echo setenv RSTUDIO_WHICH_R [your custom bin path]/R | launchctl

另一种选择是设置从/usr/local/bin到自定义R路径的软链接,但是上述方法似乎是一个更好的解决方案.

Another option is to set a softlink from /usr/local/bin to the custom R path, but the above seems like a better solution.

launchctl setenv RSTUDIO_WHICH_R [your custom bin path]/R

但是重新启动后launchctl再次忘记了环境变量.
因此,必须创建launchctl的LaunchAgent-.plist. 可以在此处找到说明.

But after a restart launchctl has forgotten the environment variable again.
Therefore a LaunchAgent-.plist for launchctl must be created. Instructions could be found here.

这篇关于如何为RStudio自定义R位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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