I am trying to execute a R file from java, here is the code i have tried.
RCaller caller = new RCaller();
RCode code = new RCode();
caller.setRscriptExecutable("D:\\R\\R-3.0.2\\bin\\Rscript.exe");
code.clear();
caller.setRCode(code);
code.R_source("D:\\Data\\Workspace\\Cpackage\\try.R");
caller.setRCode(code);
caller.runOnly();
try.R file
myinput<-function(){
//loading a csv file,reading it and creating an excel file(Working when it is run from r directly)
}
myinput()
The above rcaller java code does not do anything.Please help if i am doing anything wrong,i need to do this very badly. If there is anyother way to achieve this please suggest!