[Rd] passing a 2D array from Java to R

Simon Urbanek simon.urbanek at r-project.org
Fri Mar 18 20:48:06 CET 2011


On Mar 18, 2011, at 1:52 PM, jcg3441 wrote:

> I have a 2D array of type double in java and I want to pass this data to R
> in order to compute some statistics. Can anyone help me with this ? 
> 

The best place would be the appropriate mailing list of the package that use use for R/Java communication. If it's rJava then stats-rosuda-devel mailing is the list to ask.

In R matrices are vectors of the length m*n so you can either create one array with the values in Java, assign it (let's say to A) and call matrix(A,m,n) or you can simply pull the array as-is to R and run something like sapply(a,.jevalArray).

Cheers,
Simon



More information about the R-devel mailing list