Java-R integration?

后端 未结 8 1041
南方客
南方客 2020-11-30 21:05

I have a Java app which needs to perform partial least squares regression. It would appear there are no Java implementations of PLSR out there. Weka might have had something

相关标签:
8条回答
  • 2020-11-30 21:06

    Renjin is an alternative that allows not only the integration of many packages of R also a easy going communication between Java and R through objects:

    http://www.renjin.org/

    0 讨论(0)
  • 2020-11-30 21:10

    JRI has both low level and High level interface to Call R from Java. There is an eclipse plugin that helps in setting up the R Java environment at http://www.studytrails.com/RJava-Eclipse-Plugin/.

    0 讨论(0)
  • 2020-11-30 21:11

    There has been work by Duncan Temple Lang: http://rss.acs.unt.edu/Rdoc/library/SJava/Docs/RFromJava.pdf .

    My guess as to the most robust solution would be JGR. The developers of JGR have a mailing list, Stats-Rosuda and the mailing list Archive indicates the list remains active as of 2013.

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

    0 讨论(0)
  • 2020-11-30 21:18

    FastR is a GraalVM based implementation of R. Embedding it in a JVM application is as simple as:

    Context ctx = Context.newBuilder("R").allowAllAccess(true).build();
    ctx.eval("R", "sum").execute(new int[] {1,2,3});
    

    More details in this article: https://medium.com/graalvm/faster-r-with-fastr-4b8db0e0dceb

    0 讨论(0)
  • 2020-11-30 21:19

    This seems to be an old question. However Rserve and rJava are two good packages to integrate R with Java. Following blogs explain usage of both 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/

    I hope this will help.

    0 讨论(0)
  • 2020-11-30 21:26

    This is an old question.. but for anyone browsing through here that is still interested: I wrote a blog article that provides a detailed example of how to use JRI/rjava (a JNI based bridge) to do this type of thing (the how-to is focused on Linux dev environments). I also compare and contrast alternative approaches for doing 'mathy' stuff by calling out to R and similar frameworks.

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

    0 讨论(0)
提交回复
热议问题