Skip to contents

Create Julia environment to simulate stock-and-flow models. use_julia() looks for a Julia installation, and will install Julia as well as some required packages if not found. Keep in mind that the installation can take around 5-15 minutes. In every R session, use_julia() needs to be run once, which can take around 20 seconds.

Usage

use_julia(
  stop = FALSE,
  version = "latest",
  JULIA_HOME = NULL,
  dir = NULL,
  force = FALSE,
  force_install = FALSE,
  ...
)

Arguments

stop

If TRUE, stop active Julia session. Defaults to FALSE.

version

Julia version. Default is "latest", which will install the most recent stable release.

JULIA_HOME

Path to Julia installation. Defaults to NULL to locate Julia automatically.

dir

Directory to install Julia. Defaults to NULL to use default location.

force

If TRUE, force Julia setup to execute again.

force_install

If TRUE, force Julia installation even if existing version is found. Defaults to FALSE.

...

Optional arguments passed to JuliaCall::julia_setup()

Examples

# Start Julia session
use_julia()
#> Starting Julia ...
#> Connecting to Julia TCP server at localhost:11980 ...
#> Setting up Julia environment for sdbuildR...
# Stop Julia session
use_julia(stop = TRUE)