From 20d9895648efec241bff57a4ae39c1648648b08a Mon Sep 17 00:00:00 2001 From: Ante Bing Date: Wed, 19 Aug 2026 20:15:11 +0000 Subject: [PATCH] Stop the lago_report() example from hanging the pkgdown build The lago_report() example was wrapped in \donttest, and lago_report() renders an HTML file with rmarkdown. pkgdown runs \donttest examples in-process (build_site_github_pages(new_process = FALSE)), and a document render nested inside pkgdown's own knitr session deadlocks, which left the pkgdown job running for hours. R CMD check --as-cran runs the same example without hanging because its render happens in a separate context. Wrap the example in \dontrun instead, matching visualize_cost(): a function that writes a file and invokes pandoc should not auto-run during a check or an in-process docs build. Regenerates man/lago_report.Rd. --- R/lago_report.R | 5 ++++- man/lago_report.Rd | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/lago_report.R b/R/lago_report.R index 11d98c8..ee2f0a9 100644 --- a/R/lago_report.R +++ b/R/lago_report.R @@ -29,7 +29,10 @@ #' @return The path to the rendered HTML file, invisibly. #' #' @examples -#' \donttest{ +#' # lago_report() renders an HTML file with rmarkdown, so it is wrapped in +#' # \dontrun: it writes to disk and invokes pandoc, and running a document +#' # render inside an in-process documentation build (e.g. pkgdown) can deadlock. +#' \dontrun{ #' result <- lago_optimization( #' data = BB_data, #' outcome_name = "pp3_oxytocin_mother", diff --git a/man/lago_report.Rd b/man/lago_report.Rd index aefe013..0392019 100644 --- a/man/lago_report.Rd +++ b/man/lago_report.Rd @@ -48,7 +48,10 @@ Rendering requires the \pkg{rmarkdown} and \pkg{knitr} packages (listed under Suggests). If they are not installed, an informative error is raised. } \examples{ -\donttest{ +# lago_report() renders an HTML file with rmarkdown, so it is wrapped in +# \dontrun: it writes to disk and invokes pandoc, and running a document +# render inside an in-process documentation build (e.g. pkgdown) can deadlock. +\dontrun{ result <- lago_optimization( data = BB_data, outcome_name = "pp3_oxytocin_mother",