New version : Rcaller 2.0

[2011/07/08] Now, Rcaller has a new version, 2.0!

Change Log for version 2.0:

  • Support for R plots.
  • Easier code handling.
  • Language conversation logic is now faster.
  • Source code is published in Google Code and is open for new contributions.
RCaller is used by several users that interested in both R and Java. I was planning to submit a new version that includes functionality for plot handling and something useful. Now, with the version 2.0, i have re-written the code with a different logic. 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.
RCaller 2.0 is now in Google Code, both source code and the compiled jar file is ready for download. Remember that, nobody used it yet (2011.07.08) and it should be erroneous.I will trace the bugs more frequently by today and submit new versions immediately.
Another important issue: The R package Runiversal is installed when the RCaller 2.0 is first used in a machine. You can install this manullay, if you want, by typing

install.packages("Runiversal")

in R interactive console. This package was also written by me and any code in this project is completely distributed (Version 2.0) under the GNU Lesser Public Licence (GNU LGPL). If you use open source libraries in your projects, you probably know what the GPL licences are for, but if you are not familier with them, roughly speaking, they are more than a simple recursion :) . See details in the Google project home page of RCaller.

A blog entry and some examples are ready in site Practical Code Solutions. Please browse the test package in the source code of RCaller for the examples. I will prepare some helpful documents when i have more time. Please do not hesitate to ask for help.



RCaller

RCaller is an other simple way to call R from Java without JNI. There are lots of queries in the internet about "how to call r from java" or "call r function from java with / without JNI". There are some solutions about these works, for example, RServe is a server application written in C and it waits for socket connections, then accepts clients and runs the R code that sent from socket streams and returns SEXP 's (S / R Expressions). Also, rJava is a JNI solution for calling R from Java. But as i see, users don't want to struggle this things and they seeks more practical solutions.

RCaller uses neither sockets nor JNI interface for calling R functions from Java. RCaller simply runs RScript executable file using java's Runtime and Process classes. Then runs R commands using arguments and handles results using streams. RCaller converts R objects to Java's double or String arrays using a R script (The R package Runiversal) and XML parsers. After these operations R results can be handled by the user using the getter methods.

You can use it in your Java applications that needs some statistical calculations. Implementation and setting-up processes are easy.


An Example:




Plotting with RCaller:






You can have look at the older versions of RCaller by clicking here.

Donate!

RCaller is a free time project. If you use it and RCaller makes you happy, please donate

Download source code and jars


Version2.0
Netbeans project and source codeVisit Google Code
Jars (RCaller.jar)Download


Version0.5.2
Netbeans project and source codeDownload
Jars (RCaller.jar and bsh-core-2.0b4.jar)Download


Version0.5.1
Netbeans project and source codeDownload
Jars (RCaller.jar and bsh-core-2.0b4.jar)Download


If you like this solution or you have got any questions, you can send e-mail using mhsatman [at] yahoo.com.
Mehmet Hakan Satman, Istanbul University, Faculty of Economics, Department of Econometrics

Back to home



View My Stats