Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interfacing R to Java

Tags:

java

r

Is rjava the only way to connect R to Java? I am asking because there is a disclaimer at the end of the web page:

This interface uses Java reflection API to find the correct method so it is much slower and may not be right (works for simple examples but may not for more complex ones). For now its use is discouraged in programs as it may change in the future.

This is slightly concerning. How do you address this issue? I know that Rweka has a self-contained interface, so I may look into that package, but maybe many R users have already gone through the pains.

like image 355
gappy Avatar asked Sep 16 '09 14:09

gappy


People also ask

Can we integrate R with Java?

rJava provides a low-level bridge between R and Java (via JNI). It allows to create objects, call methods and access fields of Java objects from R. JRI is a Java/R Interface providing a Java API to R functionality.

What is rJava package?

The rJava package gives access to low-level R functions to the Java interface, but it is not provided with TIBCO Enterprise Runtime for R. These instructions help you prepare your computer to use rJava.


1 Answers

It is not the only one as the Omegahat project also has the RSJava package. But as many of the other brilliant innovations from Omegahat (which practically speaking is really just Duncan Temple Lang), this one may not build as easily or reliably.

The rJava package on the other hand is used by almost thirty other packages

CADStat, Containers, Deducer, JGR, RFreak, RImageJ, RJDBC, RLadyBug, aCGH.Spline, ant, arulesNBMiner, colbycol, cshapes, dynGraph, farmR, gWidgetsrJava, glmulti, helloJavaWorld, iplots, rSymPy, rcdk, rcdklibs, scagnostics, spcosa, RKEA, RWeka, Snowball, openNLP, wordnet

which I take as quite the endorsement.

like image 136
Dirk Eddelbuettel Avatar answered Oct 05 '22 21:10

Dirk Eddelbuettel