From 859746cb549c53cce8fd06a79eb7df78f4edb7b3 Mon Sep 17 00:00:00 2001 From: Kyle Grealis Date: Thu, 22 Jan 2026 14:54:48 -0600 Subject: [PATCH 1/2] Resolves #12: add option for verbose output (default is TRUE to be silent) --- R/use_jama_theme.R | 14 +++++++++++--- man/use_jama_theme.Rd | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/R/use_jama_theme.R b/R/use_jama_theme.R index 5cf92fe..ff30700 100644 --- a/R/use_jama_theme.R +++ b/R/use_jama_theme.R @@ -5,6 +5,9 @@ #' for use with sumExtras functions, providing professional medical journal #' formatting with reduced padding and consistent styling. The theme remains #' active for the entire R session or until changed with another theme. +#' +#' @param quiet Logical. Output message "Applied JAMA compact theme to {gtsummary}". +#' Default is TRUE. #' #' @returns Invisibly returns the theme list object from #' \code{gtsummary::theme_gtsummary_compact("jama")}. The theme is applied @@ -74,13 +77,18 @@ #' #' @family theme functions #' @export -use_jama_theme <- function() { +use_jama_theme <- function(quiet = TRUE) { if (!requireNamespace("gtsummary", quietly = TRUE)) { stop("Package 'gtsummary' is required. Please install it.", call. = FALSE) } theme <- gtsummary::theme_gtsummary_compact("jama") - gtsummary::set_gtsummary_theme(theme) - message("Applied JAMA compact theme to {gtsummary}") + + if (!quiet) { + gtsummary::set_gtsummary_theme(theme) + message("Applied JAMA compact theme to {gtsummary}") + } else { + suppressMessages(gtsummary::set_gtsummary_theme(theme)) + } invisible(theme) } diff --git a/man/use_jama_theme.Rd b/man/use_jama_theme.Rd index 2a930ba..bbeb9f2 100644 --- a/man/use_jama_theme.Rd +++ b/man/use_jama_theme.Rd @@ -4,7 +4,11 @@ \alias{use_jama_theme} \title{Apply JAMA Compact Theme to gtsummary Tables} \usage{ -use_jama_theme() +use_jama_theme(quiet = TRUE) +} +\arguments{ +\item{quiet}{Logical. Output message "Applied JAMA compact theme to {gtsummary}". +Default is TRUE.} } \value{ Invisibly returns the theme list object from From f608a31a9b39e0f546cd305264c6f9a24a95e46c Mon Sep 17 00:00:00 2001 From: Kyle Grealis Date: Thu, 22 Jan 2026 14:58:28 -0600 Subject: [PATCH 2/2] version patch: silence use_jama_theme --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 68da780..8cb3c57 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sumExtras Title: Extra Functions for 'gtsummary' Table Styling -Version: 0.3.0 +Version: 0.3.1 Authors@R: c( person( diff --git a/NEWS.md b/NEWS.md index 6ff3846..414a518 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# sumExtras 0.3.1 + +## Improvements + +* Added `quiet = TRUE` default to `use_jama_theme()` to suppress messages from {gtsummary} and {sumExtras}. Resolves issue #12 (thank you @RaymondBalise). + # sumExtras 0.3.0 ## New Features