Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 11 additions & 3 deletions R/use_jama_theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
6 changes: 5 additions & 1 deletion man/use_jama_theme.Rd

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

Loading