Skip to content

passing a 2D array from Java to R

2 messages · jcg3441, Simon Urbanek

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

            
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