Thursday, May 15, 2014

New Release: RCaller 2.3.0

New version of RCaller has just been uploaded in the Google Drive repository.

The new version includes basic bug fixes, new test files and speed enhancements.

XML file structure is now smaller in size and this makes RCaller a little bit faster than the older versions.

The most important issue in this release is the method

public int[] getDimensions(String name)

which reports the dimensions of a given object with 'name'. Here is an example:

int n = 21;
        int m = 23;
        double[][] data = new double[n][m];
        for (int i=0;i<data.length;i++){
            for (int j=0;j<data[0].length;j++){
                data[i][j] = Math.random();
        RCaller caller = new RCaller();
        RCode code = new RCode();
        code.addDoubleMatrix("x", data);
        int[] mydim = caller.getParser().getDimensions("x");
        Assert.assertEquals(n, mydim[0]);
        Assert.assertEquals(m, mydim[1]);

In the code above, a matrix with dimensions 21 and 23 is passed to R and got back to Java. The variable mydim holds the number of rows and columns and they are as expected as 21 and 23.

Please use the download link

to access compiled jar files of RCaller.

Good luck!


  1. Hi,

    I'm getting an error when running "" with RCaller 2.3.0: and R 3.1.0:

    Exception in thread "main" rcaller.exception.ParseException: Can not handle R results due to : rcaller.exception.ParseException: Can not parse output: The generated file C:\Users\DIOGOR~1\AppData\Local\Temp\Routput8095126795141229916 is empty
    at rcaller.RCaller.runAndReturnResult(
    at rCaller_test.DataFileExample.(
    at rCaller_test.DataFileExample.main(

    It seems that the generated xml file is always empty: cat(makexml(obj=data, name="data"), file="C:/Users/DIOGOR~1/AppData/Local/Temp/Routput5423426613685665392")

    I've also installed RUniversal just in case, but same mistake.

    Any help?

    Thanks in advance:

  2. Hi!

    I am getting this error:

    rcaller.exception.ExecutionException: runiversal.R in package: java.lang.NullPointerException

    This is my code:

    RCaller caller = new RCaller();

    caller.setRscriptExecutable("C:\\Program Files\\R\\R-3.1.0\\bin\\Rscript.exe");

    RCode code = new RCode();


    The error happens when an instance of RCode is being created. The RCode constructor calls the method clear(), which return this exception.

    I have already installed Runiversal package by using this command: install.packages("Runiversal")

    Could you help me figure out what is wrong?