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

tab_source_note

Add a source note citation


Description

Add a source note to the footer part of the gt table. A source note is useful for citing the data included in the table. Several can be added to the footer, simply use multiple calls of tab_source_note() and they will be inserted in the order provided. We can use Markdown formatting for the note, or, if the table is intended for HTML output, we can include HTML formatting.

Usage

tab_source_note(data, source_note)

Arguments

data

A table object that is created using the gt() function.

source_note

Text to be used in the source note. We can optionally use the md() and html() functions to style the text as Markdown or to retain HTML elements in the text.

Value

An object of class gt_tbl.

Figures

Function ID

2-7

See Also

Examples

# Use `gtcars` to create a gt table;
# add a source note to the table
# footer that cites the data source
tab_1 <-
  gtcars %>%
  dplyr::select(mfr, model, msrp) %>%
  dplyr::slice(1:5) %>%
  gt() %>%
  tab_source_note(
    source_note = "From edmunds.com"
  )

gt

Easily Create Presentation-Ready Display Tables

v0.2.2
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>), Joe Cheng [aut], Barret Schloerke [aut] (<https://orcid.org/0000-0001-9986-114X>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

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