From edd at debian.org  Sun Dec  6 19:56:22 2015
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 6 Dec 2015 12:56:22 -0600
Subject: [Rd] How to efficiently share data (a dataframe) between R and
	Java
In-Reply-To: <466cd25ef41dbefc2ee18c725a581e78@imap.fit.cvut.cz>
References: <466cd25ef41dbefc2ee18c725a581e78@imap.fit.cvut.cz>
Message-ID: <22116.34006.897439.639480@max.nulle.part>


On 6 December 2015 at 18:36, Ing. Jaroslav Kucha? wrote:
| in our ongoing project we use Java implementations of several
| algorithms. We also provide a ?wrapper? implemented as an R package
| using rJava (https://github.com/jaroslav-kuchar/rCBA). Based on our
| recent experiments, the significant portion of time is spent on copying
| a dataframe from R to Java. The Java implementation needs access to the
| source dataframe. 
| 
| I have tested several approaches: calling Java method row-by-row;
| serialize the whole data-frame to a temp file and parsing in Java; or
| row binding to a single vector and calling a single Java method. Each
| approach has its limitations e.g. time-consuming row-by-row copying,
| serialization and parsing performance or memory limitations of a single
| vector. 
| 
| Is there an efficient approach how to copy a dataframe from R to Java
| and another one from Java to R?
| 
| Thanks for any help you can provide...

Have you looked at the gold standard that is Rserve and its dedicated
clients, starting with the Java one?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] How to efficiently share data (a dataframe) between R and Java
Dirk Eddelbuettel