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 to do it...

Execute the Java program from your command prompt to invoke an R script from a Java program. Be sure to change the last part to reflect your R working directory:

java -Djava.library.path=/Library/Frameworks/R.framework/Resources/library/rJava/jri/ -cp ..:../lib/* javasamples.InvokeRScript mpg weight /Users/sv/book/Chapter11 

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