RStudio 未在 Ubuntu 16.04 上加载 RevoScaleR [英] RStudio not loading RevoScaleR on Ubuntu 16.04
问题描述
长话短说:
调用 rxImport()
在终端 R 会话中工作正常,但在使用 RStudio 时失败,尽管使用相同的 R 安装.
Long story short:
Calling rxImport()
works fine in a Terminal R session but fails when using RStudio, despite using the same installation of R.
设置:
我想在 Ubuntu 上使用 RevoScaleR 函数,如 rxImport(...).我通过包管理器安装了 RStudio 和 R.
Setup:
I'd like to use RevoScaleR functions like rxImport(...) on Ubuntu. I have an installation of RStudio and R done through package manager.
我已经按照说明安装了 MS Rclient 此处.一切似乎都正常,因为我可以在终端中运行:
I've installed MS Rclient following the instructions here. Everything seems to work as I can run in the terminal:
/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 安装:
So the function is loaded and available by default. Now I tell the RStudio to use this installation of R by adding the following at the end of ~/.profile
:
RSTUDIO_WHICH_R="/opt/microsoft/rclient/3.4.3/bin/R/R"
错误:
当我运行 rstudio
时,我在 IDE 中得到一个 R 控制台,说:
Error:
When I run rstudio
I get a R console in the IDE saying:
> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : could not find function "rxImport"
可能的原因
我发现一些线程有人抱怨 MS 软件包没有正确处理~
和工作目录(即在远程服务器上),但是 setwd()
不能解决我的问题.
Possible causes
I've found some threads with people complaining about MS packages not dealing properly with ~
and working directory (i.e. on a remote server), setwd()
doesn't solve my issue, though.
您对如何让 RevoScaleR 与 RStudio 一起工作有任何想法吗?提前致谢.
Do you have any ideas on how to get RevoScaleR to work with RStudio? Thanks in advance.
推荐答案
我从 Github 得到的回答:https://github.com/rstudio/rstudio/issues/2455#issuecomment-375327109
An answer I got from 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
这篇关于RStudio 未在 Ubuntu 16.04 上加载 RevoScaleR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!