
Generate a summary report for an energyRt object
Source:R/report.R, R/compare_scenarios.R, R/report_elements.R
report.RdCreates a PDF, HTML, or LaTeX document summarising key parameters of the
object. The layout and content are controlled by the template
argument.
For a technology, the datasheet describes that technology. For a
repository, model, or solved scenario, give the
technology via name = : the same datasheet is produced, but the
embedded levelized cost is computed for that container / solution (the
scenario method uses the ex-post cost from the solved model).
Without name, the container methods report the whole object:
model/repositorya full model report – the configuration (regions, horizon, calendar, discount), an inventory of commodities / supplies / demands / trade / constraints, the process availability windows chart, and every technology and storage described one-by-one (diagram + key parameters).
scenarioa results overview of the solved scenario – solve status and objective, generation / capacity / new-capacity mixes (via
getMixandautoplot), a sub-annual dispatch profile when the calendar has one, emissions and cost tables.
Usage
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
...
)
# S4 method for class 'technology'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
levcost_peers = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'storage'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'repository'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
logos = NULL,
figure = NULL,
groups = NULL,
...
)
# S4 method for class 'model'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
logos = NULL,
figure = NULL,
groups = NULL,
...
)
# S4 method for class 'scenario'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
run = NULL,
verify = TRUE,
logos = NULL,
badges = NULL,
groups = NULL,
...
)
# S4 method for class 'list'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'scenarios_cmp'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'commodity'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'supply'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'demand'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'trade'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'import'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'export'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'weather'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'tax'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'subsidy'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'constraint'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'calendar'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'horizon'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'config'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)
# S4 method for class 'costs'
report(
object,
template = NULL,
image_file = NULL,
file = NULL,
format = c("html", "pdf", "tex", "docx"),
levcost = NULL,
cost_unit = NULL,
open = interactive(),
reports_path = NULL,
force = FALSE,
...
)Arguments
- object
An energyRt S4 object:
technology,repository,model, or solvedscenario.- template
Character. Template name that defines which parameters to display. Currently
"generic"is built into the package. Pass the absolute path to a custom.Rmdfile to use your own template. DefaultNULLselects"generic"automatically.- image_file
Character. Optional path to a PNG/JPG image displayed in the upper-right corner of the page. Defaults to the object's own
misc$imagewhen that names an existing local file (seeobject_image);NULLwith nomisc$imageskips the image.- file
Character. Destination file path (used verbatim). Without it the report lands inside the owning folder's
reports/when the object is saved (a scenario folder, a model/repository store entry), and otherwise in the temporary project-levelget_reports_path()folder.- format
Character. Output format:
"html"(default),"pdf","tex"(standalone LaTeX source), or"docx"(Word; the templates' LaTeX styling degrades to Word's own styles). Multiple values are accepted; one file is produced per format."pdf"/"tex"require a LaTeX installation (e.g.tinytex::install_tinytex()) and are skipped with a warning when none is found.- levcost
A
levcost(orlevcost_list) object returned bylevcost, orNULL(default). WhenNULLand anylevcostkeyword arguments are passed via...(e.g.group,repo,discount),levcost()is called automatically onobjectwith those arguments. On a whole-model or scenario report,levcost = TRUEadds the levelized-cost comparison section (overall and per-topology-group charts + table).For a process declaring vintages or clusters the report carries the per-variant levelised costs (a table plus a comparison chart) alongside the detail figures for one display instance. Pass
by_variant = FALSEin...to report that single instance only.by_variantis consumed byreport()and deliberately not forwarded tolevcost(), whoseby_variant = TRUEreturns an extracted data frame rather than the object the report is built from.- cost_unit
Character or
NULL. Cost unit label used on LCOE axis (e.g."USD/GJ").NULLderives the label fromobject@units.- open
Logical. Open the rendered report in the system browser/viewer when done. Defaults to
interactive()(opens in an interactive session, stays quiet in scripts and knits).- ...
Arguments forwarded to
levcost(whenlevcost = NULLand levcost parameters are provided) and/or tormarkdown::render(). Knownlevcostparameter names are intercepted automatically; everything else is passed to the renderer. For a whole-scenario report,levcost = TRUEadds an ex-post levelized-cost table vialevcost(scenario).- levcost_peers
A
levcost_listof the process's topology-group peers, rendered as a comparison chart. Filled automatically when the datasheet is requested from a container (report(mod, name = )); rarely passed by hand.- reports_path
Character. Redirects the default output directory for this call (
file =still wins).- force
Logical. Re-render even when the existing files are up to date. Reports are skip-if-current: a sidecar (
*.report.yml) records a content key over the object, template, arguments, image and levcost identity, and an unchanged report is not rebuilt.- logos
Character vector of image paths rendered as a banner row (
model/repository/scenariomethods). Given explicitly it REPLACES themisc-derived set entirely and every file must exist;NULL(default) takesmisc$logos, then the scalarmisc$logo/misc$image– a scenario shows its model's logos first, then its own.- figure
An optional half-page hero figure (
model/repositorymethods);NULL(default) takesmisc$figure.- groups
Process groups for model and scenario reports: a named list whose elements are character vectors of process names or regular expressions over process names (
list(Coal = "_coal_", Wind = c("WIN_ON", "^R._win"))). Defaults toobject@misc$report_groups(a scenario falls back to its model's).FALSEdisables groups,"topology"groups automatically by structure. Without groups the report shows a representative sample of up to 12 processes. Processes in no group form a final "Ungrouped" sample.- run
Character or
NULL(scenariomethod). The run id to report, as listed byscenario_runs("<solve>"or"<variant>/<solve>"). The defaultNULLreports the active run; a different run is read into a local copy, so the caller's scenario keeps its active run.- verify
Logical (
scenariomethod), defaultTRUE: include theverify_solutionchecks section.- badges
Small property-indicator images (
scenariomethod);NULL(default) takesmisc$badges.Branding content enters the render key, so a changed logo or figure re-renders an otherwise up-to-date report.
Value
The path(s) to the generated output file(s) (invisibly). A single string when one format is requested; a character vector when multiple formats are requested.
Functions
report(commodity): Element datasheets. Every element class – commodity, supply, demand, trade, import, export, weather, tax, subsidy, constraint, calendar, horizon, config, costs – has areport()method rendering a one-object datasheet from its shippedreport_<class>.Rmdtemplate. The default template is the class name; an object-level default can be stored inmisc$report(the techspecreport:key), and an explicittemplate =always wins. From a container,report(mod, name = "X")finds the element of any class (passclass =to disambiguate same-named objects); the levelized cost section applies to technology, storage and trade only.