【发布时间】:2018-03-08 17:34:12
【问题描述】:
长话短说:
调用 rxImport() 在终端 R 会话中工作正常,但在使用 RStudio 时失败,尽管使用了相同的 R 安装。
设置:
我想在 Ubuntu 上使用像 rxImport(...) 这样的 RevoScaleR 函数。我通过包管理器完成了 RStudio 和 R 的安装。
我已经按照here 的说明安装了 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.
所以该函数默认加载并可用。现在我通过在~/.profile 的末尾添加以下内容来告诉 RStudio 使用 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 一起工作有任何想法吗?提前致谢。
【问题讨论】:
标签: r rstudio ubuntu-16.04 revoscaler