Skip to contents

Builds an Rmd file from data and renders it to HTML.

Usage

generate_report(
  data,
  theme_set,
  correlations_df,
  insights,
  export_files,
  consolidated = NULL,
  learning_context = NULL,
  provider = NULL,
  config = NULL,
  output_file = "analysis_report.html",
  irr_result = NULL,
  comparison_result = NULL,
  self_contained = TRUE,
  coding_results = NULL,
  coding_state = NULL,
  excerpt_verification = NULL,
  theme_group_tests = NULL,
  cooccurrence_tests = NULL,
  audit_log = NULL,
  response_cache = NULL,
  coverage = NULL,
  framework_spec = NULL,
  framework_archive = NULL,
  metric_interpretation = NULL,
  methodology_articulations = NULL,
  research_coverage = NULL,
  temporal_results = NULL
)

Arguments

data

tibble with all analysis columns

theme_set

ThemeSet object

correlations_df

Correlations tibble

insights

Insights list

export_files

List of export file paths

consolidated

ConsolidatedCodes list (or NULL)

learning_context

LearningContext object (or NULL)

provider

AIProvider object (or NULL)

config

ThematicConfig object (or NULL)

output_file

Path for the HTML report

irr_result

Inter-rater reliability result list (or NULL)

comparison_result

ComparisonResult object from compare_runs() (or NULL)

self_contained

If TRUE (default), produce a self-contained HTML file with all resources embedded. Set to FALSE for faster rendering and smaller file size (external CSS/JS will be referenced).

coding_results

Legacy CodingResults list as returned by as_coding_results. Used to populate per-theme entry tables with the codes assigned to each entry. Pass NULL to omit the codes column.

coding_state

ProgressiveCodingState with saturation data (or NULL)

excerpt_verification

Optional list returned by verify_excerpts containing substring_stats and (optionally) coherence_stats. When provided, the report's data-quality appendix shows excerpt validation results.

theme_group_tests

Optional tibble returned by compare_theme_groups (Mann-Whitney U tests). When provided, the correlation section gains a 'Theme Group Comparisons' subsection.

cooccurrence_tests

Optional tibble returned by test_theme_cooccurrence (chi-square / Fisher tests). When provided, the correlation section gains a 'Theme Co-occurrence' subsection.

audit_log

Optional AuditLog object forwarded to generate_ai_synthesis so the executive-summary AI call is recorded as an ai_request audit decision.

response_cache

Optional ResponseCache object forwarded to generate_ai_synthesis so the raw API response is written to the cache and referenced from the audit log.

coverage

Optional CorpusCoverage object (T0.3) from compute_corpus_coverage. When provided, the report renders a Tier-0 corpus-coverage card asserting that every entry surviving preprocessing reached the LLM (entry-level coverage; within-entry truncation is measured and disclosed when tracked). When NULL the card renders an explicit "coverage not computed" notice rather than silently omitting – absence is itself a transparency signal per AC4.

framework_spec

Optional FrameworkSpec object (Mode 3 only). When provided AND config$methodology$mode is "framework_applied", the report renders a Framework Declaration section with the framework's name, citations, epistemic stance, anomaly handling policy, and full constructs list. NULL on Mode 1 / Mode 2 runs.

framework_archive

Optional named list returned by archive_framework_spec carrying the archived framework's path + sha256 hash. When provided alongside framework_spec, the Framework Declaration section includes the sha256 fingerprint and a link to the archived spec.

metric_interpretation

Optional MetricInterpretation (from the Methodology Assistant). Threaded to aggregate_theme_statistics so per-subtheme stats are computed via the AI's chosen primitives (per-column, matched by name) with the legacy battery as fallback. NULL -> legacy only.

methodology_articulations

Optional MethodologyArticulations bundle. Drives the report's "Methodology Setup" section (relevance criterion + per-metric interpretations + per-theme temporal panel). When NULL, the renderer falls back to reading the archived rules/methodology_articulations.json under the output dir if present; when neither is available the section is omitted. When supplied and metric_interpretation is NULL, the metric interpretation is derived from this bundle.

research_coverage

Optional ResearchCoverage object (Mode 2 only). Drives the "Research-question coverage" section – where each named focus facet landed across the themes. When NULL, the renderer falls back to the archived rules/research_coverage.json under the output dir if present; when neither is available (or no separable facets were found) the section is omitted.

temporal_results

Optional list from analyze_temporal_patterns. Drives the "Longitudinal Patterns" section (period granularity, theme prevalence over time, theme emergence). Each chart is embedded only when its PNG exists in the output directory (the prevalence chart requires more than one time period; the emergence chart at least one dated theme). NULL -> the section is omitted.

Value

Path to generated HTML report