O'Reilly logo

R Data Analysis Cookbook by Shanthi Viswanathan, Viswa Viswanathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Rserve to call R functions from Java

The Rserve package is a TCP/IP server that accepts requests from clients. RServe allows other technologies to access R. Every connection has a separate workspace and working directory.

Getting ready

If you have not already downloaded the files for this chapter, do so now and ensure that the files are in your R working directory:

  • Create a javasamples folder and move all the files with extension Java and class into this folder under your working directory.
  • Install Rserve using install.packages('Rserve').
  • Load the package using library(Rserve).
  • Download the three JAR files JRI.jar, REngine.jar, and JRIEngine.jar from http://www.rforge.net/JRI/files/ and the RserveEngine.jar from http://www.rforge.net/Rserve/files/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required