rxp_load: Load Output of a Derivation

View source: R/rxp_read_load.R

rxp_loadR Documentation

Load Output of a Derivation

Description

Loads the output of derivations in the parent frame of the current session, returns a path if reading directly is not possible.

Usage

rxp_load(derivation_name, which_log = NULL, project_path = ".")

Arguments

derivation_name

Character, the name of the derivation.

which_log

Character, defaults to NULL. If NULL the most recent build log is used. If a string is provided, it's used as a regular expression to match against available log files.

project_path

Character, defaults to ".". Path to the root directory of the project.

Details

When derivation_name points to a single R object, it gets loaded in the current session using assign(..., envir = parent.frame()), which corresponds to the global environment in a regular interactive session. If you're trying to load a Python object and {reticulate} is available, reticulate::py_load_object() is used and then the object gets loaded into the global environment. In case the derivation is pointing to several outputs (which can happen when building a Quarto document for example) or loading fails, the path to the object is returned instead.

Value

Nothing, this function has the side effect of loading objects into the parent frame.

See Also

Other utilities: print.rxp_derivation(), rxp_check_chronicles(), rxp_copy(), rxp_gc(), rxp_init(), rxp_inspect(), rxp_list_logs(), rxp_read(), rxp_trace()

Examples

## Not run: 
  # Load an R object
  rxp_load("mtcars")

  # Load a Python object
  rxp_load("my_python_model")

  # Load from a specific build log
  rxp_load("mtcars", which_log = "2025-05-10")

## End(Not run)

rixpress documentation built on Feb. 19, 2026, 9:06 a.m.