Skip to contents

Orchestrates all steps from data loading through report generation. Supports checkpoint/resume for expensive API operations. Drives Modes 2 (Codebook Collaborative) and 3 (Framework Applied); Mode 1 (Reflexive Scaffold) uses run_mode1 instead.

Usage

run_analysis(config_path, resume = FALSE, config_overrides = list())

Arguments

config_path

Path to YAML config file. The config must declare methodology$mode as one of "codebook_collaborative" or "framework_applied" (Mode 1 has its own entry point). For Mode 3, the config must also set methodology$framework_spec_path to a built-in framework alias ("tpb", "comb", "tdf") or a path to a custom framework YAML/JSON.

resume

Logical; if TRUE, resume from last checkpoint. Per AC5 (soft-lock with audit trail), a finalized run cannot be resumed in place – doing so would overwrite the canonical outputs without a fork record. Use clone_run_with_new_mode to fork into a new run dir.

config_overrides

Named list of overrides applied after the YAML config is loaded. Two equivalent styles are supported and may be mixed: dot-path keys (list("study.research_focus" = "x")) and nested named lists (list(study = list(research_focus = "x"))). Both deep-merge into the loaded config; sibling fields under the same parent key are preserved. See load_config for the full leaf-vs-recurse rule.

Value

Invisible list with data, analytic_data, coding_state, theme_set, correlations, insights, learning_context, comparison_result, export_files, temporal_results (the analyze_temporal_patterns() result, or NULL when the corpus has no std_timestamp column or the analysis failed; when temporal data exist, the prevalence/emergence PNGs are written to output_dir when produced – the prevalence chart requires more than one time period and the emergence chart at least one dated theme), output_dir, config, integrity.

See also

run_mode1 (Mode 1 entry point); create_config (config builder); load_framework_spec (Mode 3 framework loader); vignette("methodology-modes") (per-mode worked examples).

Examples

if (FALSE) { # \dontrun{
# Mode 2 (Codebook Collaborative) -- the auto-pipeline
create_config(
  methodology = "codebook_collaborative",
  study_name = "My Study",
  research_focus = "How does X relate to Y?",
  database_path = "my_data.db",
  output_path = "config.yaml"
)
result <- run_analysis("config.yaml")

# Mode 3 (Framework Applied) -- apply a theoretical framework
create_config(
  methodology = "framework_applied",
  framework_spec_path = "tpb",  # built-in TPB; or path to custom spec
  study_name = "TPB analysis",
  research_focus = "Behavioral intention -> behavior",
  database_path = "my_data.db",
  output_path = "config.yaml"
)
result <- run_analysis("config.yaml")
} # }