Skip to content

calling r from java (Eduard Drenth)

3 messages · Eduard Drenth, Adrian Trapletti

#
Hi Eduard,

I recommend separating the R quant code from Java and deploy the R code as
a REST service, e.g. using https://github.com/opencpu/opencpu

Best regards
Adrian

Adrian Trapletti

Steinstrasse 9b, 8610 Uster, Switzerland
P +41 44 994 56 30  |  M +41 79 103 71 31
adrian at trapletti.org  |  www.trapletti.org
On Sat, Nov 28, 2020 at 12:00 PM <r-help-request at r-project.org> wrote:
https://stat.ethz.ch/pipermail/r-help/attachments/20201127/7d818716/attachment-0001.sig

  
  
#
Because of efficiency? But almost all development I do is in
Java/Xml/XQuery so I am interested in efficiently integrating the two.
And for our small institution it is important to limit the number of
technologies / frameworks.
Bye, Eduard
-----Original Message-----From: Adrian Trapletti <adrian at trapletti.org>
To: Eduard Drenth <edrenth at fryske-akademy.nl>Cc: 
R-help at r-project.orgSubject: Re: calling r from java (Eduard
Drenth)Date: Sat, 28 Nov 2020 20:36:14 +0100
Hi Eduard,
I recommend separating the R quant code from Java and deploy the R code
as a REST service, e.g. using https://github.com/opencpu/opencpu  

Best regards
Adrian

Adrian Trapletti

Steinstrasse 9b, 8610 Uster, Switzerland
P +41 44 994 56 30  |  M +41 79 103 71 31
adrian at trapletti.org  |  www.trapletti.org
On Sat, Nov 28, 2020 at 12:00 PM <r-help-request at r-project.org> wrote:
---
fa5236c2ca174ba8e839129cb0b6b047527a0f67.camel at fryske-akademy.nl>
ProcessBuilder),
efficiently
https://stat.ethz.ch/pipermail/r-help/attachments/20201127/7d818716/attachment-0001.sig

  
    
1 day later
#
Calling R via Rserve is faster than a REST based solution. However, if you
do some non-trivial computation in R, then the calling overhead is
insignificant. A REST based solution is more flexible. A REST API can be
called e.g. directly from a Javascript UI and the indirection via a Java
backend is not necessary. I see that there is a Javascript client for
Rserve https://github.com/cscheid/rserve-js but the last release is from
2013. Or if you think later that Python is more suited to do this type of
work, then you can simply replace the R REST service with a Python REST
service without touching the Java code.

Cheers,
Adrian

*Adrian Trapletti*

Steinstrasse 9b, 8610 Uster, Switzerland
P +41 44 994 56 30  |  M +41 79 103 71 31
adrian at trapletti.org  |  www.trapletti.org


On Sun, Nov 29, 2020 at 9:12 AM Eduard Drenth <edrenth at fryske-akademy.nl>
wrote: