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 に「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)
I can, however, CLOSE the connection:
RS.close(c)
>NULL
c ## Closed Rserve connection
After closing the connection, I also tried the options (also tried with argument 'c', even though the connection is closed):
RS.server.shutdown()
RSshutdown()
So, my questions are:
1- How can I close Rserve gracefully?
2- Can Rserve be used without RSclient?
I also looked at
How to Shutdown Rserve(), running in DEBUG
but the question refers to the debug mode and is also unresolved. (I don't have enough reputation to comment/ask whether the shutdown works in the non-debug mode).
Also looked at:
how to connect to Rserve with an R client
Thanks so much!