modify_source_note: Modify source note

View source: R/modify_source_note.R

modify_source_noteR Documentation

Modify source note

Description

Add and remove source notes from a table. Source notes are similar to footnotes, except they are not linked to a cell in the table.

Usage

modify_source_note(x, source_note, text_interpret = c("md", "html", "none"))

remove_source_note(x, source_note_id = NULL)

Arguments

x

(gtsummary)
A gtsummary object.

source_note

(string)
A string to add as a source note.

text_interpret

(string)
String indicates whether text will be interpreted with gt::md() or gt::html(). Must be "md" (default), "html", or "none". "none" applies no interpretation, rendering the text verbatim (useful when the text contains markdown-significant characters). Applies to tables printed with {gt}.

source_note_id

(integers)
Integers specifying the IDs of the source notes to remove. Source notes are indexed sequentially at the time of creation. Default is NULL, which removes all source notes.

Details

Source notes are not supported by as_kable_extra().

Value

gtsummary object

See Also

Footnotes vs Source Notes vs Abbreviations

Examples


# Example 1 ----------------------------------
tbl <- tbl_summary(trial, include = c(marker, grade), missing = "no") |>
  modify_source_note("Results as of June 26, 2015")
tbl

# Example 2 ----------------------------------
remove_source_note(tbl, source_note_id = 1)


gtsummary documentation built on Aug. 26, 2026, 9:07 a.m.