opt_footnote_marks {gt}R Documentation

Option to modify the set of footnote marks

Description

Alter the footnote marks for any footnotes that may be present in the table. Either a vector of marks can be provided (including Unicode characters), or, a specific keyword could be used to signify a preset sequence. This function serves as a shortcut for using tab_options(footnotes.marks = {marks})

Usage

opt_footnote_marks(data, marks = "numbers")

Arguments

data

The gt table data object

⁠obj:<gt_tbl>⁠ // required

This is the gt table object that is commonly created through use of the gt() function.

marks

Sequence of footnote marks

⁠vector<character>⁠ // default: "numbers"

Either a character vector of length greater than 1 (that will represent the series of marks) or a single keyword that represents a preset sequence of marks. The valid keywords are: "numbers" (for numeric marks), "letters" and "LETTERS" (for lowercase and uppercase alphabetic marks), "standard" (for a traditional set of four symbol marks), and "extended" (which adds two more symbols to the standard set).

Value

An object of class gt_tbl.

Specification of footnote marks

We can supply a vector that will represent the series of marks. The series of footnote marks is recycled when its usage goes beyond the length of the set. At each cycle, the marks are simply doubled, tripled, and so on (e.g., * -> ⁠**⁠ -> ⁠***⁠). The option exists for providing keywords for certain types of footnote marks. The keywords are:

The symbolic marks are the: (1) Asterisk, (2) Dagger, (3) Double Dagger, (4) Section Sign, (5) Double Vertical Line, and (6) Paragraph Sign; the "standard" set has the first four, "extended" contains all.

Examples

Use a summarized version of the sza dataset to create a gt table, adding three footnotes (with three calls of tab_footnote()). We can modify the footnote marks to use with the opt_footnote_marks() function. With the keyword "standard" we get four commonly-used typographic marks.

sza |>
  dplyr::filter(latitude == 30) |>
  dplyr::group_by(tst) |>
  dplyr::summarize(
    SZA.Max = if (
      all(is.na(sza))) {
      NA
    } else {
      max(sza, na.rm = TRUE)
    },
    SZA.Min = if (
      all(is.na(sza))) {
      NA
    } else {
      min(sza, na.rm = TRUE)
    },
    .groups = "drop"
  ) |>
  gt(rowname_col = "tst") |>
  tab_spanner_delim(delim = ".") |>
  sub_missing(
    columns = everything(),
    missing_text = "90+"
  ) |>
  tab_stubhead(label = "TST") |>
  tab_footnote(
    footnote = "True solar time.",
    locations = cells_stubhead()
  ) |>
  tab_footnote(
    footnote = "Solar zenith angle.",
    locations = cells_column_spanners(
      spanners = "spanner-SZA.Max"
    )
  ) |>
  tab_footnote(
    footnote = "The Lowest SZA.",
    locations = cells_stub(rows = "1200")
  ) |>
  opt_footnote_marks(marks = "standard")
This image of a table was generated from the first code example in the `opt_footnote_marks()` help file.

Function ID

10-3

Function Introduced

v0.2.0.5 (March 31, 2020)

See Also

Other table option functions: opt_align_table_header(), opt_all_caps(), opt_css(), opt_footnote_spec(), opt_horizontal_padding(), opt_interactive(), opt_row_striping(), opt_stylize(), opt_table_font(), opt_table_lines(), opt_table_outline(), opt_vertical_padding()


[Package gt version 0.11.0 Index]