{"id":13707827,"url":"https://github.com/JuliaInterop/JuliaCall","last_synced_at":"2025-05-06T04:30:56.804Z","repository":{"id":41243260,"uuid":"99278989","full_name":"JuliaInterop/JuliaCall","owner":"JuliaInterop","description":"Embed Julia in R","archived":false,"fork":false,"pushed_at":"2024-12-07T14:12:30.000Z","size":30182,"stargazers_count":274,"open_issues_count":83,"forks_count":36,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-03T05:03:57.702Z","etag":null,"topics":["julia","r"],"latest_commit_sha":null,"homepage":"https://juliainterop.github.io/JuliaCall/index.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaInterop.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json"}},"created_at":"2017-08-03T22:08:52.000Z","updated_at":"2025-04-24T06:21:14.000Z","dependencies_parsed_at":"2022-08-10T01:43:17.026Z","dependency_job_id":"d13b4ee6-20e3-4e4a-84d6-a55bf1d1db2b","html_url":"https://github.com/JuliaInterop/JuliaCall","commit_stats":{"total_commits":1077,"total_committers":12,"mean_commits":89.75,"dds":0.0687093779015785,"last_synced_commit":"fb8dcf89bbb91b926c4646d7243e0af4773d34a1"},"previous_names":["non-contradiction/juliacall"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaInterop%2FJuliaCall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaInterop%2FJuliaCall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaInterop%2FJuliaCall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaInterop%2FJuliaCall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaInterop","download_url":"https://codeload.github.com/JuliaInterop/JuliaCall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252621816,"owners_count":21777874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia","r"],"created_at":"2024-08-02T22:01:45.057Z","updated_at":"2025-05-06T04:30:56.795Z","avatar_url":"https://github.com/JuliaInterop.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# JuliaCall for Seamless Integration of R and Julia\n\n[![R build status](https://github.com/JuliaInterop/JuliaCall/workflows/R-CMD-check/badge.svg)](https://github.com/JuliaInterop/JuliaCall/actions)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/JuliaCall)](https://cran.r-project.org/package=JuliaCall)\n[![](https://cranlogs.r-pkg.org/badges/JuliaCall)](https://cran.r-project.org/package=JuliaCall)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/JuliaCall)](https://cran.r-project.org/package=JuliaCall)\n[![DOI](http://joss.theoj.org/papers/10.21105/joss.01284/status.svg)](https://doi.org/10.21105/joss.01284)\n\n\n**[Table of Contents]**\n\u003c!-- Table of contents generated generated by http://tableofcontent.eu --\u003e\n\n- [JuliaCall for Seamless Integration of R and Julia](#juliacall-for-seamless-integration-of-r-and-julia)\n  - [Installation](#installation)\n  - [Basic Usage](#basic-usage)\n  - [Troubleshooting and Ways to Get Help](#troubleshooting-and-ways-to-get-help)\n  - [JuliaCall for R Package Developers](#juliacall-for-r-package-developers)\n  - [Suggestion, Issue Reporting, and Contributing](#suggestion-issue-reporting-and-contributing)\n  - [Other Interfaces Between R and Julia](#other-interfaces-between-r-and-julia)\n\nPackage `JuliaCall` is an R interface to `Julia`, \nwhich is a high-level, high-performance dynamic programming language\nfor numerical computing, see \u003chttps://julialang.org/\u003e for more information.\nBelow is an image for [Mandelbrot set](https://en.wikipedia.org/wiki/Mandelbrot_set).\nJuliaCall brings **more than 100 times speedup** of the calculation!\nSee \u003chttps://github.com/JuliaInterop/JuliaCall/tree/master/example/mandelbrot\u003e for more information.\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n![](https://JuliaInterop.github.io/JuliaCall/articles/mandelbrot.png)\n\n## Installation\n\nYou can install `JuliaCall` just like any other R packages by\n\n```{r eval=FALSE}\ninstall.packages(\"JuliaCall\")\n```\n\nTo use `JuliaCall` you must have a working installation of Julia.\nThis can be easily done via:\n\n```{r eval=FALSE}\nlibrary(JuliaCall)\ninstall_julia()\n```\n\nwhich will automatically install and setup a version of Julia specifically\nfor use with JuliaCall. Or you can do\n\n```{r eval=FALSE}\nlibrary(JuliaCall)\njulia_setup(installJulia = TRUE)\n```\n\nwhich will invoke `install_julia` automatically if Julia is not found \nand also do initialization of `JuliaCall`.\n\nYou can also setup Julia manually by downloading a generic binary from \n\u003chttps://julialang.org/downloads/\u003e and add it to your path. Currently \n`Julia v0.6.x` and the `Julia v1.x` releases are all supported by \n`JuliaCall`.\n\nYou can get the development version of `JuliaCall` by\n\n```{r eval=FALSE}\ndevtools::install_github(\"JuliaInterop/JuliaCall\")\n```\n\n## Basic Usage\n\nBefore using `JuliaCall`, you need to do initial setup by function `julia_setup()` for automatic type conversion, Julia display systems, etc. \nIt is necessary for every new R session to use the package.\nIf not carried out manually, it will be invoked automatically before other `julia_xxx` functions.\nSolutions to some common error in `julia_setup()` are documented in the [troubleshooting section](#troubleshooting-and-ways-to-get-help).\n\n```{r}\nlibrary(JuliaCall)\njulia \u003c- julia_setup()\n\n## If you want to use `Julia` at a specific location, you could do the following:\n## julia_setup(JULIA_HOME = \"the folder that contains Julia binary\").\n## You can also set JULIA_HOME in command line environment or use `options(...)`.\n\n## Different ways of using Julia to calculate sqrt(2)\n\n# julia$command(\"a = sqrt(2);\"); julia$eval(\"a\")\njulia_command(\"a = sqrt(2);\"); julia_eval(\"a\")\njulia_eval(\"sqrt(2)\")\njulia_call(\"sqrt\", 2)\njulia_eval(\"sqrt\")(2)\njulia_assign(\"x\", sqrt(2)); julia_eval(\"x\")\njulia_assign(\"rsqrt\", sqrt); julia_call(\"rsqrt\", 2)\n2 %\u003eJ% sqrt\n\n## You can use `julia$exists` as `exists` in R to test\n## whether a function or name exists in Julia or not\n\njulia_exists(\"sqrt\")\njulia_exists(\"c\")\n\n## Functions related to installing and using Julia packages\n\njulia_install_package_if_needed(\"Optim\")\njulia_installed_package(\"Optim\")\njulia_library(\"Optim\")\n```\n\n## Troubleshooting and Ways to Get Help\n\n### Julia is not found\n\nMake sure the `Julia` installation is correct.\n`JuliaCall` can find `Julia` on PATH,\nand there are three ways for `JuliaCall` to find `Julia` not on PATH.\n\n- Use `julia_setup(JULIA_HOME = \"the folder that contains julia binary\")`\n- Use `options(JULIA_HOME = \"the folder that contains julia binary\")`\n- Set `JULIA_HOME` in command line environment.\n\n### libstdc++.so.6: version `GLIBCXX_3.4.xx' not found\n\nSuch problems are usually on Linux machines.\nThe cause for the problem is that R cannot find the libstdc++ version needed by `Julia`.\nTo deal with the problem, users can export \"TheFolderContainsJulia/lib/julia\" to R_LD_LIBRARY_PATH.\n\n### RCall not properly installed\n\nThe issue is usually caused by updates in R, and it can be typically solved by setting `rebuild` argument to `TRUE` in `julia_setup()` as follows.\n\n```{r eval=FALSE}\nJuliaCall::julia_setup(rebuild = TRUE)\n```\n\n### `ERROR: could not load library \"/usr/lib/x86_64-linux-gnu/../bin/../lib/x86_64-linux-gnu/julia/sys.so\"`\n\nThis error happens when Julia is built/installed with `MULTIARCH_INSTALL=1`, as\nit is on e.g. Debian. It is caused by [the bindir-locating code in jl\\_init not\nbeing multiarch-aware](https://github.com/JuliaLang/julia/issues/32614#issuecomment-656787386).\nTo work around it, try setting `JULIA_BINDIR=/usr/bin` in [`.Renviron`](https://rstats.wtf/r-startup.html#renviron).\n\n### How to Get Help\n\n- One way to get help for Julia functions is just using `julia$help` as the following example:\n\n```{r}\njulia_help(\"sqrt\")\n```\n\n- The GitHub Pages for this repository host the documentation for the development version of `JuliaCall`: \u003chttps://JuliaInterop.github.io/JuliaCall/\u003e.\n\n- Also, you are more than welcome to contact me about `JuliaCall` at \u003clch34677@gmail.com\u003e or \u003ccxl508@psu.edu\u003e.\n\n## JuliaCall for R Package Developers\n\nIf you are interested in developing an `R` package which is an interface for\na `Julia` package, `JuliaCall` is an ideal choice.\nYou only need to find the `Julia` function or `Julia` module you want to have in `R`, `using` the module, and `julia_call` the function.\nThere are some examples:\n\n- [`diffeqr`](https://github.com/SciML/diffeqr) is a package for solving differential equations in `R`. It utilizes [DifferentialEquations.jl](https://diffeq.sciml.ai/latest/) for its core routines to give high performance solving of ordinary differential equations (ODEs), stochastic differential equations (SDEs), delay differential equations (DDEs), and differential-algebraic equations (DAEs) directly in `R`.\n- [`convexjlr`](https://github.com/Non-Contradiction/convexjlr) is an `R` package for Disciplined Convex Programming (DCP) by providing a high level wrapper for `Julia` package [`Convex.jl`](https://github.com/jump-dev/Convex.jl). `convexjlr` can solve linear programs, second order cone programs, semidefinite programs, exponential cone programs, mixed-integer linear programs, and some other DCP-compliant convex programs through `Convex.jl`.\n- [`ipoptjlr`](https://github.com/Non-Contradiction/ipoptjlr) provides an `R` interface to the `Ipopt` nonlinear optimization solver. It provides a simple high-level wrapper for `Julia` package [`Ipopt.jl`] (https://github.com/jump-dev/Ipopt.jl).\n- [`FixedEffectjlr`](https://github.com/FixedEffects/FixedEffectjlr) uses the `Julia` package [`FixedEffectModels.jl`](https://github.com/matthieugomez/FixedEffectModels.jl) to estimate large fixed effects models in `R`.\n- [Julia MixedModels from R](http://rpubs.com/dmbates/377897) illustrates how to use `JuliaCall` and `Julia` package [`MixedModels.jl`](https://github.com/JuliaStats/MixedModels.jl) to build mixed models in `R`.\n- [`autodiffr`](https://github.com/Non-Contradiction/autodiffr) provides automatic differentiation to native `R` functions by wrapping `Julia` packages [`ForwardDiff.jl`](https://github.com/JuliaDiff/ForwardDiff.jl) and [`ReverseDiff.jl`](https://github.com/JuliaDiff/ReverseDiff.jl) through `JuliaCall`, which is a work in progress.\n\nIf you have any issues in developing an `R` package using `JuliaCall`,\nyou may report it using the link: \u003chttps://github.com/JuliaInterop/JuliaCall/issues/new\u003e, or email me at \u003clch34677@gmail.com\u003e or \u003ccxl508@psu.edu\u003e.\n\n## Suggestion, Issue Reporting, and Contributing\n\n`JuliaCall` is under active development now.\nAny suggestion or issue reporting is welcome!\nYou may report it using the link: \u003chttps://github.com/JuliaInterop/JuliaCall/issues/new\u003e, or email me at \u003clch34677@gmail.com\u003e or \u003ccxl508@psu.edu\u003e.\nYou are welcome to use the [issue template](https://github.com/JuliaInterop/JuliaCall/blob/master/.github/ISSUE_TEMPLATE/bug_report.md)\nand the [pull request template](https://github.com/JuliaInterop/JuliaCall/blob/master/.github/pull_request_template.md).\nThe [contributing guide](https://github.com/JuliaInterop/JuliaCall/blob/master/.github/CONTRIBUTING.md) provides some guidance for making contributions.\n\n### Checking `JuliaCall` Package\n\nTo check and test the `JuliaCall` package, you need to have the source package. You can \n\n- download the source of `JuliaCall` from Github,\n- open `JuliaCall.Rproj` in your RStudio or open `R` from the downloaded directory,\n- run `devtools::test()` to see the result of the test suite.\n- run `devtools::check()` or click the `Check` button in the RStudio Build panel in the upper right to see the result of `R CMD check`.\n\n## Other Interfaces Between R and Julia\n\n- [`RCall.jl`](https://github.com/JuliaInterop/RCall.jl) is a `Julia` package which embeds `R` in `Julia`. `JuliaCall` is inspired by `RCall.jl` and depends on `RCall.jl` for many functionalities like type conversion between `R` and `Julia`.\n- [`XRJulia`](https://github.com/johnmchambers/XRJulia) is an `R` package based on John Chambers' `XR` package and allows for structured integration of `R` with `Julia`. It connects to `Julia` and uses JSON to transfer data between `Julia` and `R`. A simple performance comparison between `XRJulia` and `Julia` can be found in [`JuliaCall` JOSS paper](https://doi.org/10.21105/joss.01284).\n- [`RJulia`](https://github.com/armgong/rjulia) is an `R` package which embeds `Julia` in `R` as well as `JuliaCall`. It is not on CRAN yet, and I haven't tested it.\n\n## License\n\n`JuliaCall` is licensed under [MIT](https://cran.r-project.org/web/licenses/MIT).\n\n## Code of Conduct\n\nPlease note that the `JuliaCall` project is released with a [Contributor Code of Conduct](https://github.com/JuliaInterop/JuliaCall/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.\n\n## Citing\n\nIf you use `JuliaCall` in research that resulted in publications, then please cite the `JuliaCall` paper using the following BibTeX entry:\n```\n@Article{JuliaCall,\n    author = {Changcheng Li},\n    title = {{JuliaCall}: an {R} package for seamless integration between {R} and {Julia}},\n    journal = {The Journal of Open Source Software},\n    publisher = {The Open Journal},\n    year = {2019},\n    volume = {4},\n    number = {35},\n    pages = {1284},\n    doi = {10.21105/joss.01284},\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaInterop%2FJuliaCall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuliaInterop%2FJuliaCall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaInterop%2FJuliaCall/lists"}