Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (5.3k points)

Julia looks very promising for fast and syntax-sane computation, but I suspect it will not be anywhere near R in terms of overall statistics workflow for some time yet. So I'd like to use it where C++ is mainly used in R programs: to optimize slow portions of code. Before I invest the time in learning Julia, though, I am curious what facilities there are for embedding Julia snippets in R code.

So:

  • What facilities are out there for linking R and Julia?
  • How robust and well-thought-out are they, on a scale of zero to Rcpp?

I want to call Julia from R, just as Rcpp allows calling C++ from within R right now. I do not want to call R from Julia. (So RCall.jl would not work)

1 Answer

0 votes
by

There is a package named Rjulia that provides an interface between R and Julia. It allows a user to run a script in Julia from R, and maps objects between the two languages.

It currently supports use on Linux and Windows (both R and RGUI), but build on Windows only for advanced users.

 

You can install rjulia on Windows using the Rtools and devtools package :

install.packages("devtools") 

devtools::install_github("armgong/rjulia", ref="master", args = "--no-multiarch")# or ref="0.3" if using Julia v0.3

 

You need to install the DataArrays and DataFrames packages in order to use R or Julia objects containing NA values, factors, or data frames.

Note:

Due to RStudio issue (https://github.com/armgong/rjulia/issues/16), when using rjulia on Windows 64bit, RStudio-0.98.1103 is recommended http://download1.rstudio.org/RStudio-0.98.1103.zip .

...