One call turns an object, a model, a solved scenario or a comparison into a document: HTML, PDF, Word or LaTeX
PDF, A4, one page · energyRt 0.91.5.9015 (dev) · 2026-11-29An object
report(ECOA)
Its diagram, parameters and an ex-ante levelized cost.
A model
report(mod)
Configuration, inventory, investment windows, then every process.
A solved scenario
report(CO2CAP)
Status, objective, mixes, a dispatch day, emissions and costs.
A comparison
report(cmp)
cmp <- compare_scenarios(list(BASE, CO2CAP)): what differs, and where.The call
report(object, template, file, format, levcost, open, ...)Renders, writes and (interactively) opens a document; returns its path.
format = "html" |
self-contained page (default) |
"pdf", "tex"
|
need LaTeX (tinytex); skipped with a warning without it |
"docx" |
Word, in Word's own styles |
c("html", "pdf") |
one file per format |
report_html(), report_pdf(), report_docx(), report_tex() are the same call with the format fixed.
By class
| technology, storage | datasheet: diagram, parameters, levelized cost; model =, scenario = place it in a system, geoscale = maps it |
| commodity, supply, demand, import, export, trade, weather, constraint, tax, subsidy, calendar, horizon | their declared data, drawn and tabulated |
| repository, model | the whole input; groups = orders the processes |
| scenario | the results; run = picks a solve |
| comparison | two or more scenarios side by side |
report(ECOA, format = c("html", "docx"))
report(mod, groups = list(
Fossil = c("ECOA", "EGAS"),
Renewable = c("ESOL", "EWIN")))Your own template
report_templates()[, c("name",
"class")]
name class 1 calendar calendar 2 commodity commodity 3 config config 4 constraint constraint 5 costs costs …
The shipped templates: R Markdown files, one per class.
file.copy(subset(report_templates(),
name == "generic")$path, "my.Rmd")
# edit my.Rmd, then
report(ECOA, template = "my.Rmd")
A template gets the same
params as the one it was copied from.Template helpers
Each renders correctly to HTML, Word and LaTeX: call them, never hand-written markup.
report_setup() |
chunk options; returns the output kind |
report_sec() |
section title and note |
report_tbl() |
a table: rounded, pruned, scrollable |
report_fig() |
a ggplot sized by its facets |
report_img(), report_img_row()
|
images, logos |
report_header() |
name, description, logo |
report_pagebreak() |
a page break in every format |
report_fmt_val(), report_esc()
|
numbers and text |
Where they go
clear_report_cache(x, dry_run, …)A report is re-rendered only when its object changed; this forgets them (
force = TRUE for one).-
file =writes exactly there;open = FALSEin scripts. -
levcost =passes a result fromlevcost()instead of computing one. -
image_file =,logos =put pictures in the header.
In a script
for (s in list(BASE, CO2CAP))
report(s, format = c("html", "pdf"),
open = FALSE)
One document per scenario and format, named after the scenario.
- A report is re-rendered only when its object changed: after editing a template, pass
force = TRUE. -
opendefaults tointeractive(): a script writes and moves on. - PDF and LaTeX need a LaTeX installation; HTML and Word need only pandoc, which ships with RStudio and Quarto.
