Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_gtsummary_theme

Set a gtsummary theme


Description

[Experimental] Use this function to set preferences for the display of gtsummary tables. The default formatting and styling throughout the gtsummary package are taken from the published reporting guidelines of the top four urology journals: European Urology, The Journal of Urology, Urology and the British Journal of Urology International. Use this function to change the default reporting style to match another journal, or your own personal style.

Usage

set_gtsummary_theme(x)

reset_gtsummary_theme()

Arguments

x

A gtsummary theme function, e.g. theme_gtsummary_journal(), or a named list defining a gtsummary theme. See details below.

Example Output

Example

See Also

Available gtsummary themes

Examples

# Setting JAMA theme for gtsummary
set_gtsummary_theme(theme_gtsummary_journal("jama"))
# Themes can be combined by including more than one
set_gtsummary_theme(theme_gtsummary_compact())

set_gtsummary_theme_ex1 <-
  trial %>%
  dplyr::select(age, grade, trt) %>%
  tbl_summary(by = trt) %>%
  add_stat_label() %>%
  as_gt()

# reset gtsummary theme
reset_gtsummary_theme()

gtsummary

Presentation-Ready Data Summary and Analytic Result Tables

v1.4.0
MIT + file LICENSE
Authors
Daniel D. Sjoberg [aut, cre] (<https://orcid.org/0000-0003-0862-2018>), Michael Curry [aut] (<https://orcid.org/0000-0002-0261-4044>), Margie Hannum [aut] (<https://orcid.org/0000-0002-2953-0449>), Joseph Larmarange [aut] (<https://orcid.org/0000-0001-7097-700X>), Karissa Whiting [aut] (<https://orcid.org/0000-0002-4683-1868>), Emily C. Zabor [aut] (<https://orcid.org/0000-0002-1402-4498>), Esther Drill [ctb] (<https://orcid.org/0000-0002-3315-4538>), Jessica Flynn [ctb] (<https://orcid.org/0000-0001-8310-6684>), Jessica Lavery [ctb] (<https://orcid.org/0000-0002-2746-5647>), Stephanie Lobaugh [ctb], Gustavo Zapata Wainberg [ctb] (<https://orcid.org/0000-0002-2524-3637>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.