我在 Mac 和 Ubuntu 中都尝试了很多选项。我阅读了 Rserve 文档
http://rforge.net/Rserve/doc.html
对于 Rserve 和 RSclient 包:
http://cran.r-project.org/web/packages/RSclient/RSclient.pdf
http://cran.r-project.org/web/packages/Rserve/Rserve.pdf
我无法弄清楚在 Rserve 中打开/关闭连接以及“优雅地”关闭 Rserve 的正确工作流程是什么。
例如,在 Ubuntu 中,我使用 ./config --enable-R-shlib 从源代码安装 R(遵循 Rserve 文档),还在 /etc/Rserve.conf 中添加了“控制启用”行。
在 Ubuntu 终端中:
library(Rserve)
library(RSclient)
Rserve()
c<-RS.connect()
c ## this is an Rserve QAP1 connection
## Trying to shutdown the server
RSshutdown(c)
Error in writeBin(as.integer....): invalid connection
RS.server.shutdown(c)
Error in RS.server.shutdown(c): command failed with satus code 0x4e: no control line present (control commands disabled or server shutdown)
但是,我可以关闭连接:
RS.close(c)
>NULL
c ## Closed Rserve connection
关闭连接后,我还尝试了选项(也尝试使用参数“c”,即使连接已关闭):
RS.server.shutdown()
RSshutdown()
所以,我的问题是:
1- 如何优雅地关闭 Rserve?
2- 可以在没有 RSclient 的情况下使用 Rserve 吗?
我也看了
但问题是指调试模式,也没有解决。(我没有足够的声誉来评论/询问关机是否在非调试模式下工作)。
还看了:
非常感谢!