theme_gtsummary: Available gtsummary themes

Description Usage Arguments Themes Example Output See Also Examples

Description

\lifecycle

maturing The following themes are available to use within the gtsummary package. Print theme elements with theme_gtsummary_journal(set_theme = FALSE) %>% print(). Review the themes vignette for details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
theme_gtsummary_journal(
  journal = c("jama", "lancet", "nejm", "qjecon"),
  set_theme = TRUE
)

theme_gtsummary_compact(set_theme = TRUE, font_size = NULL)

theme_gtsummary_printer(
  print_engine = c("gt", "kable", "kable_extra", "flextable", "huxtable", "tibble"),
  set_theme = TRUE
)

theme_gtsummary_language(
  language = c("de", "en", "es", "fr", "gu", "hi", "is", "ja", "kr", "mr", "pt", "se",
    "zh-cn", "zh-tw"),
  decimal.mark = NULL,
  big.mark = NULL,
  iqr.sep = NULL,
  ci.sep = NULL,
  set_theme = TRUE
)

theme_gtsummary_continuous2(
  statistic = "{median} ({p25, {p75})",
  set_theme = TRUE
)

theme_gtsummary_mean_sd(set_theme = TRUE)

theme_gtsummary_eda(set_theme = TRUE)

Arguments

journal

String indicating the journal theme to follow. One of c("jama", "lancet", "nejm", "qjecon"). Details below.

set_theme

Logical indicating whether to set the theme. Default is TRUE. When FALSE the named list of theme elements is returned invisibly

font_size

Numeric font size for compact theme. Default is 13 for gt tables, and 8 for all other output types

print_engine

String indicating the print method. Must be one of "gt", "kable", "kable_extra", "flextable", "tibble"

language

String indicating language. Must be one of "de" (German), "en" (English), "es" (Spanish), "fr" (French), "gu" (Gujarati), "hi" (Hindi), "is" (Icelandic),"ja" (Japanese), "kr" (Korean), "mr" (Marathi), "pt" (Portuguese), "se" (Swedish), "zh-c,n" (Chinese Simplified), "zh-tw" (Chinese Traditional)

If a language is missing a translation for a word or phrase, please feel free to reach out on GitHub with the translated text!

decimal.mark

The character to be used to indicate the numeric decimal point. Default is "." or getOption("OutDec")

big.mark

Character used between every 3 digits to separate hundreds/thousands/millions/etc. Default is ",", except when decimal.mark = "," when the default is a space.

iqr.sep

string indicating separator for the default IQR in tbl_summary(). If decimal.mark= is NULL, iqr.sep= is ", ". The comma separator, however, can look odd when decimal.mark = ",". In this case the argument will default to an en dash

ci.sep

string indicating separator for confidence intervals. If decimal.mark= is NULL, ci.sep= is ", ". The comma separator, however, can look odd when decimal.mark = ",". In this case the argument will default to an en dash

statistic

Default statistic continuous variables

Themes

Use reset_gtsummary_theme() to restore the default settings

Review the themes vignette to create your own themes.

Example Output

Example

See Also

Themes vignette

set_gtsummary_theme(), reset_gtsummary_theme()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Setting JAMA theme for gtsummary
theme_gtsummary_journal("jama")
# Themes can be combined by including more than one
theme_gtsummary_compact()

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

# reset gtsummary themes
reset_gtsummary_theme()

gtsummary documentation built on Jan. 21, 2022, 1:09 a.m.