-3

我一直在寻找一些第三方 jar 来做一些高级的分析过程,比如 Java 中的 SQL 窗口函数,因为我们的数据库 mysql 不支持它。在谷歌的帮助下,我发现“R”虽然不是基于 java 的,但它可以解决我的大部分情况。我试过“RJava”和“Rcaller”接口来连接java。

对于性能、可扩展性和长期运行,这是在 Java 中连接 R 的最佳库。好心劝告。

4

1 回答 1

3

Assuming that "R inside Java" means calling R from Java: JRI (part of rJava) embeds R in Java. It is the most efficient way since it is a direct JNI interface. (For a deployed example see JGR).

Another alternative is Rserve which is a client/server concept. It has the penalty of serializing data between the systems, but allows parallel connections (on unix) which is not possible with JRI since R is single-threaded so it can only be run in one thread per Java process.

RCaller is the least efficient one since it simply calls R process and thus has a cold-start problem (compared to Rserve) as well as less efficient serialization.

于 2012-12-13T03:29:42.540 回答