R in Oracle Java Cloud and Existing R – Java Integration #rstats

So I finally got my test plan accepted for a 1 month trial to the Oracle Public Cloud at https://cloud.oracle.com/ .

oc1 I am testing this for my next book R for Cloud Computing ( I have already covered Windows Azure, Amazon AWS, and in the middle of testing Google Compute).

Some initial thoughts- this Java cloud seemed more suitable for web apps, than for data science ( but I have to spend much more time on this).

I really liked the help and documentation and tutorials, Oracle has invested a lot in it to make it friendly to enterprise users.

Hopefully the Oracle R Enterprise  ORE guys can talk to the Oracle Cloud department and get some common use case projects going.


In the meantime, I did a roundup on all R -Java projects.

They include-

Low-level interface to Java VM very much like .C/.Call and friends. Allows creation of objects, calling methods and accessing fields.

JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread. Basically it loads R dynamic library into Java and provides a Java API to R functionality. It supports both simple calls to R functions and a full running REPL.

In a sense JRI is the inverse of rJava and both can be combined (i.e. you can run R code inside JRI that calls back to the JVM via rJava). The JGR project makes the full use of both JRI and rJava to provide a full Java GUI for R.

Important: JRI is now part of rJava, so if you simply want to use JRI, install rJava binary and your’e all set! There will be no further stand-alone JRI releases, JRI is now released only as a part of rJava

Renjin is a new JVM-based interpreter for the R language. It is intended to be 100% compatible with the original interpreter, to run on the Google AppEngine platform, and generally to open new opportunities for embedding libraries and programs written in R.

Download the lastest buildTry the interpreter online

Rsession provides an easy to use java class giving access to remote or local R session. The back-end engine is Rserve 0.6, locally spawned automatically if necessary.

Rsession differs from Rserve as it is a higher level API, and it includes server side startup of Rserve. Therefore, it is easier to use in some point of vue, as it provides a multi session R engine (including for Windows, thanks to an ugly turn-around).

A library for calling R from Java. Also see http://stdioe.blogspot.in/search/label/rcaller

RCaller 2.0 uses the package Runiversal which has two functions for converting R list objects to Java or XML. The new logic underlying the RCaller is to translate java arrays to R, send them and the commands to R interpreter and handle the results as XML documents. XML documents then parsed using Java’s standard XML DOM document API’s. Finally, user can handle the results from Java.

Rserve is a TCP/IP server which allows other programs to use facilities of R (see www.r-project.org) from various languages without the need to initialize R or link against R library. Every connection has a separate workspace and working directory. Client-side implementations are available for popular languages such as C/C++, PHP and Java.

The following Java code illustrates the easy integration of Rserve:

RConnection c = new RConnection();
double d[] = c.eval("rnorm(10)").asDoubles();

What is JGR?
JGR (speak ‘Jaguar’) is a universal and unified Graphical User Interface for R (it actually abbreviates Java Gui for R). JGR was introduced at the useR! meeting in 2004 and there is an introductory article in the Statistical Computing and Graphics Newsletter

Author: Ajay Ohri


One thought on “R in Oracle Java Cloud and Existing R – Java Integration #rstats”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: