【问题标题】:start Rserve from Rprofile.site [closed]从 Rprofile.site 启动 Rserve [关闭]
【发布时间】:2016-05-19 12:46:44
【问题描述】:

我想使用如下所示的 Rprofile.site 启动 Rserve

 .First <- function(){
    library(Rserve)
    Rserve(args="--RS-conf /usr/lib64/R/etc/Rserv.conf")
    source("/usr/lib64/R/etc/InvestorToolBox.R")
    }

但是对于某些原因,当我运行 R 时,它会进入一个循环,在该循环中它会继续运行 Rserve 的实例,如屏幕截图所示

启动 Rserve:/usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS->conf /usr/lib64/R/etc/ 服务配置文件

R 版本 3.2.3 (2015-12-10) -- “木制圣诞树” 版权所有 (C) 2015 统计计算平台 R 基金会: x86_64-redhat-linux-gnu(64位)

R 是免费软件,绝对不提供任何担保。你是 欢迎在特定条件下重新分发。输入“许可证()” 或 'licence()' 了解分发详情。

自然语言支持,但在英语语言环境中运行

R 是一个有许多贡献者的协作项目。类型 'contributors()' 获取更多信息和 'citation()' 关于如何引用 出版物中的 R 或 R 包。

输入 'demo()' 获得一些演示,输入 'help()' 获得在线帮助,或者 'help.start()' 为 HTML 浏览器界面提供帮助。输入“q()”到 退出R。

启动 Rserve:/usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS->conf /usr/lib64/R/etc/ 服务配置文件

R 版本 3.2.3 (2015-12-10) -- “木制圣诞树” 版权所有 (C) 2015 统计计算平台 R 基金会: x86_64-redhat-linux-gnu(64位)

R 是免费软件,绝对不提供任何担保。你是 欢迎在特定条件下重新分发。输入“许可证()” 或 'licence()' 了解分发详情。

自然语言支持,但在英语语言环境中运行

R 是一个有许多贡献者的协作项目。类型 'contributors()' 获取更多信息和 'citation()' 关于如何引用 出版物中的 R 或 R 包。

输入 'demo()' 获得一些演示,输入 'help()' 获得在线帮助,或者 'help.start()' 为 HTML 浏览器界面提供帮助。输入“q()”到 退出R。

启动 Rserve:/usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS-

conf /usr/lib64/R/etc/Rserv.conf

你能告诉我为什么或我做错了什么吗?

【问题讨论】:

  • 用户对工作原理的基本误解

标签: r linux rserve


【解决方案1】:

编辑: tl;博士你做错了吗。通过在~/.Rprofile 中启动,您将获得一个读取~/.Rprofile 并启动的R 进程......然后您将获得递归。简单的解决方法是按照应有的方式使用Rserve

人们倾向于在 R 之外启动 Rserve:

edd@max:~$ R CMD Rserve 

R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Rserv started in daemon mode.
edd@max:~$ pstree -p | grep Rserve
           |-Rserve(24569)
edd@max:~$ 

RServe 有一些选项可以使用其特定的配置文件来设置特定的启动参数、身份验证选项等

【讨论】:

  • 对不起,如果我不明白你的意思,我正在使用特定配置文件作为Rserve(args="--RS-conf /usr/lib64/R/etc/Rserv.conf") 运行 Rserve,但它运行了几次,我试图以 R CMD Rserve(args="--RS-conf /usr/lib64/R/etc/Rserv.conf") 运行它但是它不起作用
  • 你的回答与问题无关
  • 不——相反,您似乎没有意识到启动 Rserve 会启动一个读取 .Rprofile 的 R 进程,因此您显然会开始递归。
  • 好的,这很有帮助,你能告诉我如何使用特定的配置文件在 R 之外运行 Rserve。?
  • 你找到Rserve documentation了吗?