I know that the JuliaCall package allows to us use the Julia language in R. But I have a jl script with complex instructions and I would like to run in the R language! For example, suposse that my jl file is "myscript.jl" return a certain array A.
#install.packages("JuliaCall")
library(JuliaCall)
Is there some function to run the jl file?
A <- somefunction("myscript.jl")
some help?
It is indeed quite simple if you have Julia on path.
First create a file
juliaScripts.jl
with content:Then in R you just do:
Note that the R vector has been automatically converted to a Julia Array.
Not to make advertising, but more details on interfacing R <-> Julia are on my Apress(2019) book "Julia Quick Syntax reference" on Chapter 7 "Interfacing Julia with other languages" (I shouldn't say it, but you can easily find the pdf online in well-known sites...)