Skip to contents

[Experimental]

Usage

render_card(result, output, format = "html", template = NULL, quiet = TRUE)

Arguments

result

A bmmtools_validation, its result.rds, or the directory it was run in.

output

The HTML file to write. Its directory is created if missing, and an existing file is replaced.

format

"html", the only format so far.

template

NULL for the card bmmtools ships (system.file("card", "card.qmd", package = "bmmtools")), or the path to a Quarto document of your own that takes the parameter result, the path to a result.rds.

quiet

Passed to quarto::quarto_render().

Value

output, invisibly.

Details

Renders the card of a run_validation() result to one self-contained HTML file: the headline verdict, the run record and the plan, the verdict of every stage beside its criterion, a section per stage in the order of the workflow (results, or why the stage did not run), the model's own sections, and the numbers that moved since the earlier result the run was compared with.

The template prints no number of its own: every figure on the card is read off the result (its numbers, verdicts, stages, run_info and plan), so a card always describes the run it was rendered from.

Requirements

The quarto R package and the Quarto CLI (https://quarto.org); both are checked before anything is rendered.

Examples

if (FALSE) { # \dontrun{
plan <- validation_plan("ezdm", seed = 2026)
result <- run_validation(plan, "validation/ezdm")
render_card(result, "validation/ezdm/card.html")
} # }