本文介绍了如何在Windows中从Java自动启动Rserve的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中创建了一个Java应用程序.该应用程序使用Rserve软件包连接到R和运行r脚本.在运行我的应用程序之前,我必须像这样从Rstudio中启动储备金:

I have created a java application in eclipse. The application used Rserve package to connect to R and run r scripts. Before running my application, i have to start rserve from within Rstudio like this:

library(Rserve)
Rserve()

此Java代码将捆绑为可执行文件,因此有一种方法可以在代码运行后立即自动在Windows中调用Rserve(),这样我就可以跳过通过以下方式启动Rserve的手动步骤: RStudio?

This Java code would be bundled as an executable file, so is there a way that Rserve() is invoked automatically(in windows) as soon as the code is run so that I can skip this manual step of starting Rserve using through RStudio?

推荐答案

https://github.com/yannrichet/rsession 项目完全可以为您实现目标.

The https://github.com/yannrichet/rsession project achieves exactly that for you.

尽管看一下它可能很有趣: https://github.com/subes/invesdwin-context-r 由于它集成了RSession并出于性能原因保留了一个Rserve连接池,而无需为此做很多事情.您也可以切换到其他运行时解决方案,例如JRI,RCaller,Renjin,而无需更改脚本代码.

Though it might be interesting to have a look at this: https://github.com/subes/invesdwin-context-rAs it integrates RSession and keeps a pool of Rserve connections for performance reasons without you having to do much for it. You can also switch to other runtime solutions like JRI, RCaller, Renjin without having to change your script code.

这篇关于如何在Windows中从Java自动启动Rserve的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:17