
Export a self-contained reproducible study bundle from a validated spec_ir
Source: R/bundle.R
export_spec_bundle.RdWrites a path-safe reproducible study directory containing:
spec.yaml: the validated declarativespec_irspecification;simulation.R: the deterministic, AST-verified standalone R script;report.qmd: the sanitized reproducible Quarto report; andbundle_manifest.json: SHA-256 checksums for every exported file plus the static AST safety attestation fromverify_compiled_r_ast().
Arguments
- spec
A validated
spec_irobject.- dir
Character path to the target bundle directory (created if needed). Must not contain
..path-traversal segments.- overwrite
Logical; if
FALSE(default), refuses to overwrite existing bundle files indir.- format
Quarto report output format (defaults to
"html").- execute_report
Logical; whether Quarto report chunks default to
eval: true(default) oreval: false.
Examples
spec <- new_spec_ir(hierarchy = list(levels = 1L, n_obs = 120L),
simulation = list(n_reps = 10L, seed = 42L))
out_dir <- file.path(tempdir(), "specshiny_bundle_example")
res <- export_spec_bundle(spec, out_dir, overwrite = TRUE)
verify_spec_bundle(out_dir)$valid
#> [1] TRUE
unlink(out_dir, recursive = TRUE)