O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

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

How it works...

In step 1, we set up the environment variables R_HOME to where R has been installed and add the R bin directory to the environment variable PATH. If these environment variables are not set, you will see the following error message:

"R_HOME is not set. Please set all required environment variables before running this program. 
Unable to start R." 

In step 2, we run the SimpleJRIStat Java program. Open the SimpleJRIStat.java code:

  • In the main method, we first create an instance of Rengine to begin an R session.
  • We check to make sure that the R session is active with the waitForR method.
  • We create an array of doubles in Java and assign it to a variable called values. The values variable exists in the R environment and not in ...

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