Linking R and Julia?

后端 未结 8 1358
面向向阳花
面向向阳花 2020-12-22 16:00

Julia looks very promising for fast and syntax-sane computation (e.g. here), but I suspect it will not be anywhere near R in terms of overall statistics workflow for some ti

8条回答
  •  旧时难觅i
    2020-12-22 16:42

    I create an R package called JuliaCall recently, which embeds Julia in R. The package is on CRAN.

    https://cran.r-project.org/web/packages/JuliaCall/index.html

    https://github.com/Non-Contradiction/JuliaCall

    The usage of the package is like this:

    library(JuliaCall)
    julia <- julia_setup()
    julia_command("a = sqrt(2)"); julia_eval("a")
    julia_eval("sqrt(2)")
    julia_call("sqrt", 2)
    julia_eval("sqrt")(2)
    

    As you can see, you could send command strings and call Julia functions really easily.

    And there are also some R packages wrapping Julia packages using JuliaCall, for example,

    • convexjlr for Disciplined Convex Programming in R using Convex.jl, which is also on CRAN.
    • ipoptjlr, an R Interface for Interior Point OPTimizer (IPOPT) using Julia package Ipopt.jl.

    Welcome for any feedback on JuliaCall!!

提交回复
热议问题