How do we invoke R language / R script from java? Basically I need java kind of wrapper around R script.
Data will be given to java layer say method setData(double[]) which should in turn sends to R script - let us say setDataR(double []) method.
R script will perform some computation say calls method double[] computeR().
Java program will get the computation result by invoking double[] getData() which in turn delegates to R script to get the computated data.
How can this be performed by JRI, Rserv, Rcaller? I do not see any way to invoke Rscript methods? Please send sample. It should be simular to JNI (java, C++) invocations.
- Does within jvm I think multiple threads cannot invoke R script call correct? Any work around?
Thanks