Skip to contents

Create Julia environment to simulate stock-and-flow models. use_julia() looks for a Julia installation, and if found, will set up a Julia project enviroment. In most cases, this will require installing some packages. The Julia project environment is located in the inst directory of the sdbuildR package ("Project.toml").

Usage

use_julia(stop = FALSE, JULIA_HOME = NULL, force = FALSE)

Arguments

stop

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

JULIA_HOME

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

force

If TRUE, force Julia setup to execute again.

Value

Returns NULL invisibly.

Details

Keep in mind that the installation can take around 5-20 minutes. In every R session, use_julia() needs to be run once (which is done automatically in simulate()), which can take around 30 seconds.

Examples

if (FALSE)  # requires Julia setup
if (JuliaConnectoR::juliaSetupOk()) {
  # Start Julia session or set up environment (first time use)
  use_julia()

  # Stop Julia session
  use_julia(stop = TRUE)
}
 # \dontrun{}