rjulia 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 advance users.
-
Install julia v0.5 and R version >=3.1.0.
-
Add
<juliainstalldir>/bin
to your system PATH variable if needed. -
Install the rjulia package. If you're using the v0.4 branch of julia, use the "julia0.4" branch of rjulia.
You can install rjulia on Linux using the devtools package:
install.packages("devtools") #if not already installed devtools::install_github("armgong/rjulia", ref="julia0.5")# or ref="julia0.4" if using Julia v0.5
You can install rjulia on Windows using the Rtools and devtools package :
install.packages("devtools") #if not already installed devtools::install_github("armgong/rjulia", ref="master", args = "--no-multiarch")# or ref="0.3" if using Julia v0.3
-
If you want to be able to use R or Julia objects that contain NA values or factors or data frames, the Julia packages
DataArrays
andDataFrames
must be installed.
library(rjulia)
julia_init() #**(will auto find your julia home)**
julia_eval("1+1")
Please see the *.R
files in the demo/
directory, or use
demo(package = "rjulia")
Help files are now done, mostly with examples.
-
The Julia api rapidly changes between releases. Each time you upgrade or downgrade Julia, rjulia needs to be recompiled and reinstalled, e.g. with
devtools::install_github
. -
Due to RStudio issue (#16), when using rjulia on Windows 64bit, RStudio-0.98.1103 is recommended http://download1.rstudio.org/RStudio-0.98.1103.zip .
-
Due to gcc toolchain issue , when using rjulia on Windows, it will crash R, to solve this, download unoffical build julia from https://github.com/armgong/julia-64-build-with-mingw-builds-for-R .