How to Start RServe pre-loaded with library

大城市里の小女人 提交于 2019-12-25 04:50:14

问题


I need to load a library every time I am making a new RConnection. Is it possible to have it pre-loaded when I start RServe?

Loading it every time a new RConnection is making it slower.


回答1:


Yes, you can use eval or source configuration options or --RS-source <file> command line option. Anything you load this way is pre-loaded into the server before it starts listening for connections.




回答2:


It might not be working because you're missing the quotes around the library name. Another way to do it is to put the eval line inside /etc/Rserve.conf like this:

eval library('lib1'); library('lib2'); library('lib3')



回答3:


Finally after all the research I have found that RConnection only can be loaded with library, and every RConnection needs to be initialized with all the libraries and packages.

We just need to optimize the way we are using our RConnection.



来源:https://stackoverflow.com/questions/28634345/how-to-start-rserve-pre-loaded-with-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!