Repo to demonstrate the interoperability between Java and R using GraalVM
Example to determine multiple change points in data-set using top down 'E-divisive with Means' e.divisive
& e.agglo
from the R ecp
package
Change point detection in dataset with large signal-to-noise ration
Change point detection in dataset with small signal-to-noise ration
This demo relies on GraalVM with the R runtime installed
-
Install SDK manager (https://sdkman.io/install)
$ curl -s "https://get.sdkman.io" | bash
-
Install GraalVM
Find available GraalVM distributions
$ sdk list java | grep grl
Install latest GraalVM distribution
$ sdk install java x.y.z.r11-grl
-
Set GraalVM to current java runtime
$ sdk use java 20.3.0.r11-grl
-
Install GraalVM R
$ gu install R
R should be available in your PATH
$ R --version R version 3.6.1 (FastR)
-
Install
ecp
packageThe ecp package contains the
e.divisive
function used to calculate change points in datasets$ Rscript -e 'install.packages("ecp")'
-
Run tests
$ mvn clean test
N.B. if you see errors in the maven build e.g. package org.graalvm.polyglot does not exist
please ensure that you are using GraalVM sdk see step 3
$ java --version
openjdk 11.0.9 2020-10-20
OpenJDK Runtime Environment GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06)
OpenJDK 64-Bit Server VM GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06, mixed mode, sharing)