RStudio 未在 Ubuntu 16.04 上加载 RevoScaleR

RStudio not loading RevoScaleR on Ubuntu 16.04

长话短说:
调用 rxImport() 在终端 R 会话中工作正常,但在使用 RStudio 时失败,尽管使用相同的 R 安装。

设置:
我想在 Ubuntu 上使用像 rxImport(...) 这样的 RevoScaleR 函数。我通过包管理器安装了 RStudio 和 R。

我已经按照说明安装了 MS Rclient here。 一切似乎都在终端中正常工作运行:

/opt/microsoft/rclient/3.4.3/bin/R$ ./R

R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
Microsoft R Open 3.4.3
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2018 Microsoft

Loading Microsoft R Client packages, version 3.4.3.0097. 
Microsoft R Client limits some functions to available memory.
See: https://go.microsoft.com/fwlink/?linkid=799476 for information
about additional features.
...
Using the Intel MKL for parallel mathematical computing (using 2 cores).
Default CRAN mirror snapshot taken on 2018-01-01.
See: https://mran.microsoft.com/.

> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : 'inData' must be specified.

因此该功能默认加载并可用。现在我告诉 RStudio 通过在 ~/.profile 末尾添加以下内容来使用 R 的这个安装:

RSTUDIO_WHICH_R="/opt/microsoft/rclient/3.4.3/bin/R/R"

错误:
当我 运行 rstudio 我在 IDE 中得到一个 R 控制台说:

> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : could not find function "rxImport"

可能原因
我发现 some threads 人们抱怨 MS 软件包无法正确处理 ~ 和工作目录(即在远程服务器上),但是 setwd() 并不能解决我的问题。

对于如何让 RevoScaleR 与 RStudio 一起工作,您有什么想法吗?提前致谢。

我从 Github 得到的答案: https://github.com/rstudio/rstudio/issues/2455#issuecomment-375327109

尝试设置

R_LIBS_SITE=/opt/microsoft/rclient/3.4.3/libraries/RServer

/opt/microsoft/rclient/3.4.3/runtime/R/etc/Renviron