Skip to contents

Loads a built-in or custom template by name, optionally applies parameter overrides (by UI control ID, shorthand parameter name, or dotted IR path) and/or a natural-language refinement instruction via refine_spec(), and returns the validated spec_ir.

Usage

use_spec_template(name, overrides = list(), refine = NULL, ...)

Arguments

name

Character scalar name of a template listed by list_spec_templates().

overrides

Optional named list of parameter overrides (e.g., list(n_clusters = 80L, icc = 0.25) or list("outcome.ar1_rho" = 0.5, "simulation.n_reps" = 100L)).

refine

Optional character scalar natural-language refinement instruction applied via refine_spec() after overrides.

...

Additional named overrides merged with overrides.

Value

A validated spec_ir object.

Examples

s <- use_spec_template("longitudinal_growth_ar1", n_clusters = 80L, ar1_rho = 0.5)
s$hierarchy$n_clusters
#> [1] 80
s$outcome$ar1_rho
#> [1] 0.5