Julia counterpart of run_py_step(). Runs, inside a fresh R environment, an optional R pre-script, a Python script (via JuliaCall). This is the function the target built by tar_target_jl() calls; it is exported so that call resolves at pipeline run time but this function is not destined to be called directly by the package users.
Arguments
- script
Path to the Julia script to run (required).
- pre_script
Optional path to an R script run before the Julia script. It is evaluated in the step environment, which already holds the named
inputs. To hand objects to Julia, assign a named listto_jlin this script; each element isjulia_assign()ed as a variable in Julia'sMainmodule.- post_script
Optional path to an R script run after the Julia script. It is evaluated in the same environment, which now also holds
jl_get(name)andjl_call(fn, ...). Inoutput = "object"mode the value of its last expression becomes the target value; inoutput = "file"mode it must return a character vector of file paths.- inputs
Named list of upstream target values, bound by name into the step environment. Supplied automatically by the constructor.
- output
Output mode:
"object"(default) returns a converted R object,"file"returns a character vector of file paths (and defaultsformatto"file").- retrieve
Optional character vector of foreign-session variable names to return when no
post_scriptis supplied in object mode. One name returns that object; several return a named list.- files
Optional character vector of file paths to return when no
post_scriptis supplied in file mode.- julia_version
Optional Julia version to select (e.g.
"1.11"), used whenjulia_homeis not given. Resolved to a juliaup-managed install. DefaultNULLuses the computer/global default Julia.- julia_home, julia_project, julia_packages
Julia environment selection.
julia_homeis the directory containing the julia executable (defaults togetOption("tarpolyglot.julia_home"); when unset and nojulia_version, JuliaCall discovers Julia onPATH).julia_projectis a Julia project environment (folder withProject.toml/Manifest.toml) toPkg.activate(); whenNULL, Julia's default global environment (@v#.#) is used.julia_packagesis a character vector of packages tousingbefore the script. The requested environment takes priority over an ambientJULIA_PROJECTenvironment variable (e.g. one set by an RStudio project config and inherited bycrewworkers): it is cleared for the duration of the Julia binding, so an explicitjulia_project(or the global environment you get when none is given) wins over it, rather thanJULIA_PROJECTsilently selecting a different project. (JULIA_HOMEis not cleared: it is a supported way to point at the default Julia.)
Value
The converted R object (object mode) or a character vector of normalised file paths (file mode).