Thursday, 8 August 2013

Running r script in java

Running r script in java

I have an r-script C:\Users\Desktop\test.r and would like to run it from
java code. I have tried using
try{
/*
* Creating RCaller
*/
RCaller caller = new RCaller();
/*
* Full path of the Rscript. Rscript is an executable file
shipped with R.
* It is something like C:\\Program File\\R\\bin.... in Windows
*/
caller.setRscriptExecutable("C:\\Program
Files\\R\\R-3.0.1\\bin\\x64\\Rscript.exe");
caller.R_source("C:\\Users\\Desktop\\new.r");//new.r is the
r-script i want to run.}
`

No comments:

Post a Comment