当前位置: X-MOL 学术PeerJ Comput. Sci. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Executing native Java code in R: an approach based on a local server
PeerJ Computer Science ( IF 3.5 ) Pub Date : 2020-09-28 , DOI: 10.7717/peerj-cs.300
Mathieu Fortin

The R language is widely used for data analysis. However, it does not allow for complex object-oriented implementation and it tends to be slower than other languages such as Java, C and C++. Consequently, it can be more computationally efficient to run native Java code in R. To do this, there exist at least two approaches. One is based on the Java Native Interface (JNI) and it has been successfully implemented in the rJava package. An alternative approach consists of running a local server in Java and linking it to an R environment through a socket connection. This alternative approach has been implemented in an R package called J4R. This article shows how this approach makes it possible to simplify the calls to Java methods and to integrate the R vectorization. The downside is a loss of performance. However, if the vectorization is used in conjunction with multithreading, this loss of performance can be compensated for.

中文翻译:

在R中执行本机Java代码:一种基于本地服务器的方法

R语言广泛用于数据分析。但是,它不允许复杂的面向对象的实现,并且它往往比其他语言(如Java,C和C ++)慢。因此,在R中运行本机Java代码可能会提高计算效率。为此,至少存在两种​​方法。一种基于Java本机接口(JNI),并且已在rJava软件包中成功实现。另一种方法是用Java运行本地服务器,然后通过套接字连接将其链接到R环境。此替代方法已在称为J4R的R包中实现。本文说明了这种方法如何简化对Java方法的调用并集成R向量化。缺点是性能下降。然而,
更新日期:2020-09-28
down
wechat
bug