JuliaCall
is an R package. Quarto executes Julia code using the IJulia
Jupyter kernel. To use it, specify jupyter: julia_version
in the YAML header. A Quarto installation guide is available.
To render Quarto documents that contain julia chunks
- start julia
- Enter package mode by pressing
]
.
- run
Add IJulia
- Go back to the REPL (backspace), the default prompt after you start julia
- run
using IJulia
- run
notebook()
. Use Ctrl+c or quitting julia to stop the Jupyter kernel.
If you don't have Jupyter installed at this point, this will be installed, refer to the above guide for details. This may take a while and prompt some input.
Now you should be able to render a document via the Quarto Cli from a shell and1 RStudio. For example, the following example.qmd should render and print a matrix.
---
title: "Bla"
jupyter: julia-1.8
---
```{julia}
[1 2 3]
```
This may a slow. Refer to the above guide on installing Revise.jl
and using Jupyter Cache to speed things up. I personally experience speedup in using VSCode + Quarto extension over RStudio.
If not, the following allows R users to run julia code from within R and RStudio,
- in R, use
install.package("JuliaCall")
- in R, run
JuliaCall::julia_setup()
This takes care of some PATH variable and comes with the installJulia
optional argument.
import Pkg;Pkg.add("IJulia")
in Julia mode. The rest worked perfectly, thanks! – Belshin