我在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(遵循Rserve文档)从源代码安装了R,并在/etc/Rserve.conf中添加了“control enable”行。
在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?
我也看过
但是这个问题涉及调试模式,并且也没有解决。(我没有足够的声望来评论/询问关闭是否在非调试模式下工作。)
还看了一下:
非常感谢!