| generate_report | R Documentation |
Renders an automated report from a completed event study task in one or more
output formats. Uses a bundled RMarkdown template with configurable sections.
The narrative is assembled ONCE before the format loop – es_advise is
never called per format (NARR-01).
generate_report(
task,
output_file = "event_study_report.html",
format = "html",
title = "Event Study Report",
author = NULL,
sections = c("exec_summary", "data_methods", "results", "diagnostics", "robustness",
"references"),
cross_sectional = NULL,
confidence_level = 0.95,
interactive = TRUE,
advice = NULL,
narrative = NULL,
provider = NULL,
verbose = getOption("eventstudy.verbose", TRUE),
...
)
task |
A fitted |
output_file |
Output file path (extension overridden per format).
Default |
format |
Character vector of output formats, any subset of
|
title |
Report title string. |
author |
Author name (optional, default |
sections |
Character vector of sections to include. Default is all six
fixed sections:
|
cross_sectional |
Optional cross-sectional regression results to include. |
confidence_level |
Confidence level for plots. Default 0.95. |
interactive |
Logical. Use interactive plotly plots in HTML output. Default TRUE. |
advice |
An optional grounded |
narrative |
An optional named list keyed by section (e.g.
|
provider |
Optional LLM provider passed to
|
verbose |
Logical; if FALSE, suppress informational messages. Default
|
... |
Additional arguments passed to |
A named character vector of output file paths, invisibly, keyed by
format name (e.g. c(html = "/tmp/report.html", pdf = "/tmp/report.pdf")).
A single-format call returns a length-1 named vector: result[["html"]]
and result[[1L]] both resolve (backward-compatible with prior
single-path callers).
Other eventstudy-export:
es_report(),
export_results(),
tidy.EventStudyTask()
data(dieselgate)
task <- EventStudyTask$new(dieselgate$firm, dieselgate$index, dieselgate$request)
task <- run_event_study(task, ParameterSet$new())
# Single HTML format written to a temporary directory
out <- file.path(tempdir(), "event_study_report.html")
path <- generate_report(task, output_file = out, format = "html")
path[["html"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.