Java-R integration?

I have a Java application that needs to perform partial least squares regression. It would seem that there is no Java PLSR implementation in it. At some point, Uka may be something like this, but no longer in the API. On the other hand, I found a good implementation of R that has an added bonus to it. It was used by people whose result I want to reproduce, which means that the likelihood that everything will be wrong, due to differences in the way PLSR is implemented, will be less.

Question: is there a good enough (and easy to use) package that allows Java to call R, pass some parameters to a function, and read the results? My other option is to run Java Rwn R in Process and then monitor it. Data is read and written to disk. Which of the two would you recommend? Did I miss the obvious third option?

+49
java r machine-learning regression
Sep 17 2018-11-11T00:
source share
7 answers

I have successfully used two alternatives in the past.

Jri

  • Advantages : possibly higher performance.
  • Ends : you need to set up some environment variables and libraries different in Win / UNIX.

RServe

  • Advantages : easy to configure, you do not need to initialize R or the link against any R library, it can work on another machine.
  • Cons : based on TCP / IP (server running), no callbacks from R.

Other alternatives I've never used: RCaller

+47
Sep 17 2018-11-17T00:
source share

There was the work of Duncan Lang Temple: http://rss.acs.unt.edu/Rdoc/library/SJava/Docs/RFromJava.pdf .

My guess about the most reliable solution would be JGR . JGR developers have a mailing list, Stats-Rosuda and a mailing list. Archive shows that the list has been active since 2013.

There is also code that was put into Googlecode , with an example here: http://stdioe.blogspot.com/2011/07/rcaller-20-calling-r-from-java.html

+10
sept. 2018-11-17T00:
source share

This is an old question .. but for those who are looking here, it’s still interesting: I wrote a blog article that provides a detailed example of how to use JRI / rjava (a JNI-based bridge) to accomplish this type of thing (practical guide focused on Linux dev environments). I also compare and contrast alternative approaches for creating β€œmatter,” causing R and similar structures.

URL> http://buildlackey.com/integrating-r-and-java-with-jrirjava-a-jni-based-bridge/

+8
Oct 21 '13 at 23:48 on
source share

Renjin is an alternative that not only integrates many R packages, but also easily transitions between Java and R through objects:

http://www.renjin.org/

+5
Jul 15 '15 at 19:05
source share

JRI has both a low-level and a high-level interface for calling R with Java. There is an eclipse plugin that helps in setting up the Java R environment at http://www.studytrails.com/RJava-Eclipse-Plugin/ .

+3
Jan 05 '13 at
source share

This seems to be an old question. However, Rserve and rJava are two good packages for integrating R with Java. The following blogs explain the use of both of these libraries.

For rJava: http://www.codophile.com/how-to-integrate-r-with-java-using-rjava/

For Rserve: http://www.codophile.com/how-to-integrate-r-with-java-using-rserve/

Hope this helps.

+2
May 13 '15 at 9:16
source share

I needed some time ago and tested several interfaces with R. The one that I found the best for my needs (windows, C #) was Rserve , which I believe is written in Java. My only problem is that it was not 64 bit. I used a simple client written in C # and it worked very well. I am sure the Java client is much better.

+1
Sep 17 '11 at 7:22
source share



All Articles