RJava is probably the library you need.
The JRI component (a previously independent project) allows you to execute R functions from Java. You will need to translate the source R code to your Java code using the JRI api, but it is quite simple and the library is fast.
You can install rJava from R or on ubuntu as a package using apt.
I would be careful with Java aggregate classes. For me, he calculated stupidity in some cases, so itβs better to double-check the results with R if you decide to use it.
source share