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 Java objects in R

Sometimes, we develop parts of an application in Java and need to access them from R. The rJava package allows us to access Java objects directly from within R.

Getting ready

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

  1. Create a folder called javasamples and move all the files with extension .java or .class into this folder under your working directory.
  2. Install rJava using the install.packages("rJava") command.
  3. Load the package using the library(rJava) command.
  4. For rJava to work in your environment, the JDK version should be identical for the following, and we explain how to get them in sync for Mac OS X:
    • The environment JDK version: Execute ...

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