View source: R/modify_footnote_symbol.R
| modify_footnote_symbol | R Documentation |
modify_footnote_symbol() customizes the symbols used to reference
footnotes in a gtsummary table. By default, footnotes are referenced with
sequential numbers (1, 2, 3, ...). This function replaces those numbers
with a user-specified set of symbols, e.g. c("*", "\u2020", "\u2021")
(an asterisk, dagger, and double dagger).
remove_footnote_symbol() resets the footnote reference marks back to the
default numbering.
modify_footnote_symbol(x, symbol)
remove_footnote_symbol(x)
x |
( |
symbol |
( |
The symbol sequence may also be set for all tables via the
"pkgwide-chr:footnote_symbol" theme element; a value set with
modify_footnote_symbol() takes precedence over the theme element.
Updated gtsummary object
The table below lists common footnote reference marks and the R strings used
to create them. The six marks correspond to those used in
gt::opt_footnote_marks(marks = "extended"). Pass the R string (e.g.
"\u2020") to the symbol argument to obtain the corresponding mark.
| Name | Unicode | R string |
| asterisk | U+002A | "*" |
| dagger | U+2020 | "\u2020" |
| double dagger | U+2021 | "\u2021" |
| section sign | U+00A7 | "\u00A7" |
| double vertical line | U+2016 | "\u2016" |
| pilcrow (paragraph sign) | U+00B6 | "\u00B6" |
modify_footnote_header(), modify_footnote_body(), modify_footnote_spanning_header()
# use symbols (instead of numbers) to reference footnotes
trial |>
tbl_summary(by = trt, include = c(age, grade), missing = "no") |>
add_p() |>
modify_footnote_symbol(symbol = c("*", "\u2020", "\u2021"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.