Skip to content

Commit

Permalink
Add parameter for selecting output format
Browse files Browse the repository at this point in the history
  • Loading branch information
Gotfrid authored Feb 8, 2025
1 parent d4b290f commit f358fcc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion R/reporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @param package_version Package version number.
#' @param package Path where to find a package source to retrieve name and version number.
#' @param template_path Path to a custom quarto template file
#' @param output_format Output format for the report. Default is "all".
#' @param params A list of execute parameters passed to the template
#' @param ... Additional arguments passed to `quarto::quarto_render()`
#'
Expand All @@ -24,6 +25,7 @@ package_report <- function(
package_version,
package = NULL,
template_path = system.file("report/pkg_template.qmd", package = "riskreports"),
output_format = "all",
params = list(),
...
) {
Expand Down Expand Up @@ -90,7 +92,7 @@ package_report <- function(
suppressMessages({suppressWarnings({
out <- quarto::quarto_render(
input = template,
output_format = "all",
output_format = output_format,
execute_params = params,
...
)
Expand Down
2 changes: 1 addition & 1 deletion inst/report/pkg_template.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ d_riskmetric <- readRDS(risk_path)
# Assesment produces a data.frame with one row
r_riskmetric <- riskreports::assessment(d_riskmetric)
is_na <- sapply(r_riskmetric, function(x){is.na(x) || (is.character(x) && startsWith(x, "no applicable"))})
knitr::kable(r_riskmetric[, !is_na]) # Use this to have some summary text and report it.
knitr::kable(t(r_riskmetric[, !is_na])) # Use this to have some summary text and report it.
# d_riskmetric
```

Expand Down
3 changes: 3 additions & 0 deletions man/package_report.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f358fcc

Please sign in to comment.