Skip to contents

Renders an assembled report through an R Markdown template. The bundled template covers experimental setup, the QC log, an intensity overview, the comparison summary and a session-info appendix. A custom template receives the report through its params; only the parameters a template declares are passed, so templates of different vintages keep working.

Usage

cr_render_report(
  report,
  output_dir = tempdir(),
  format = c("html", "pdf", "docx"),
  template = NULL,
  title = NULL,
  author = NULL,
  quiet = TRUE
)

Arguments

report

A cr_report from cr_report(). A cr_experiment is also accepted and is assembled into a report first.

output_dir

Output directory (default tempdir()).

format

One of "html", "pdf" or "docx".

template

Path to an R Markdown template. If NULL, the bundled template is used.

title, author

Override the report title and author. NULL keeps the values stored in the report.

quiet

Passed to rmarkdown::render().

Value

Path to the rendered document (invisibly).

Examples

# \donttest{
exp <- cr_example_experiment(seed = 1, n_cells_per_well = 10)
rep <- cr_report(exp)
if (requireNamespace("rmarkdown", quietly = TRUE) &&
    requireNamespace("knitr", quietly = TRUE) &&
    rmarkdown::pandoc_available()) {
  out <- cr_render_report(rep, output_dir = tempdir())
  basename(out)
}
#> [1] "cellreportR_report.html"
# }