1

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

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

我已经按照此处的说明安装了 MS Rclient 。一切似乎都正常,因为我可以在终端中运行:

/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 使用 R 的此安装~/.profile

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"

可能的原因
我发现一些人抱怨 MS 包没有正确处理~和工作目录(即在远程服务器上),setwd()但并没有解决我的问题。

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

4

1 回答 1

0

我从 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
于 2018-03-22T14:47:39.897 回答