Skip to contents

Renders a parameterized R Markdown template into an HTML or PDF report for a trial.

Usage

pr_export_report(
  trial,
  output_file,
  format = c("html", "pdf"),
  template = c("generic", "saddle", "foot"),
  masks = NULL,
  thresholds = NULL
)

Arguments

trial

A pr_trial object.

output_file

Character. Output file path.

format

Character. "html" (default) or "pdf".

template

Character. "generic" (default), "saddle", or "foot".

masks

Named list of masks. NULL uses the layout defaults.

thresholds

Optional reference threshold tibble.

Value

Invisibly returns the generated file path.

Details

Source recordings and symbolic-link destinations are refused. Completed reports replace existing outputs with recovery on reported failures; process termination or concurrent writers are outside this guarantee.

Examples

# \donttest{
# Rendering needs 'rmarkdown' and a pandoc installation.
if (requireNamespace("rmarkdown", quietly = TRUE) &&
  rmarkdown::pandoc_available()) {
  tmp <- tempfile(fileext = ".html")
  pr_export_report(pr_example_trial("insole"), tmp, template = "foot")
  print(file.exists(tmp))
  unlink(tmp)
}
#> [1] TRUE
# }