JuliaCon 2020 (times are in UTC)

Integrating Julia in R with the JuliaConnectoR
07-30, 17:20–17:30 (UTC), Red Track

Despite the advantages of Julia, there are some hurdles that prevent R users from making the leap and switch to Julia. To bring Julia closer to R, we developed the new "JuliaConnectoR" R package that conveniently integrates Julia in R, allowing R users to harness the power of Julia, and making it easier for Julia developers to share features of their Julia code with R users.


R and Julia are two languages that complement each other very well: R has many convenient features from a huge number of packages. Julia brings new possibilities for writing fast code and offers new and innovative packages. Integrating functionality of Julia in R is especially promising due to the many commonalities of Julia and R. We take advantage of these in the design of our "JuliaConnectoR" R package (https://github.com/stefan-m-lenz/JuliaConnectoR), which aims at a tight and stable integration of Julia in R.

The JuliaConnectoR can import Julia functions, also from whole packages, and make them directly callable in R. Values and data structures are translated between the two languages. Julia objects can be fully translated to R objects or accessed via proxy object that behave like R objects. In addition to directly using features from Julia packages, this also greatly simplifies writing own Julia code for optimizing time critical portions of R code compared to writing C extensions in R.

The possibility to pass R functions as arguments to Julia functions makes the JuliaConnectoR a truly functional interface. Such callback functions can, e. g., be used to interactively display the learning process of a neural network in R while it is trained in Julia. This sets the JuliaConnectoR apart from the other R packages for integrating Julia in R, “XRJulia” and “JuliaCall”. Additionally, the JuliaConnectoR offers features that make the interactive use more convenient and stable, such as the redirection of standard (error) output and the ability to interrupt running calls to Julia. These unique features become possible with an optimized communication protocol, based on TCP, which also allows a highly efficient data transfer by leveraging the similarities in the binary representation of values in Julia and R.

We show the implementation of the package and demonstrate the features of the JuliaConnectoR with several examples, including deep learning with the Julia package “Flux” in R and analysing large datasets via “JuliaDB”.

Researcher on deep learning with medical data at the Institute of Medical Biometry and Statistics at the University Medical Center in Freiburg im Breisgau (Germany). After studying mathematics, I have now worked for six years in the fields of medical informatics and statistics. My special interests are programming and software design.