Installing R to work with WSO2 CEP
Configuring R in Standalone Environment
Follow steps below to configure R.
Install R. For more information see The R Project for Statistical Computing. Installation instruction for each OS can be found here.
This guide uses R version 3.2.2.
- Issue the
R
command from a new terminal to check whether the R installation is successful. The following log is displayed if the installation is successful. Install JRI. For more information see Java/R Interface Documentation.
For Linux you can use 'apt-get install r-cran-rjava' command. This will install rJava into <R_Installation>/site-library/rJava/jri. This is the location you need to use as JRI_HOME
Set path accordingly for $R_HOME and $JRI_HOME
Eg: $R_HOME=/usr/lib/R $JRI_HOME=/usr/lib/R/site-library/rJava/jri
Add a symbolic link which acts as a pointer to link libjri.so file in rJava/jri/libjri.so to the installation path of R
Eg: ln -s /usr/lib/R/site-library/rJava/jri/libjri.so /usr/lib
Add following jar files which are inside jri installation (/usr/lib/R/site-library/rJava/jri) to <CARBON_HOME>/repository/components/lib
JRIEngine.jar
JRI.jar
REngine.jar