Learn R Programming

huxtable (version 6.0.1)

table_notes: Set notes beneath a table

Description

Table notes are stored separately from the table's cells. They do not change the number of rows in the huxtable. Each element of value is printed as a separate note beneath the table.

Usage

table_notes(ht)

table_notes(ht) <- value

set_table_notes(ht, value)

add_table_note(ht, value)

Value

table_notes() returns a character vector. The replacement function, set_table_notes() and add_table_note() return the modified huxtable.

Arguments

ht

A huxtable.

value

A character vector, or NA/NULL to remove all notes.

Details

Use NA or NULL to remove all table notes.

Table notes are plain text. Huxtable escapes them as required for each output format.

HTML, LaTeX, Typst and Word output use their native table-footer or table-note structures. RTF, Markdown and screen output print notes immediately after the table. Excel writes each note to a merged row below the table. Breakable LaTeX tables use the threeparttablex package.

Use cell_note() to add notes referenced from individual cells. Referenced cell notes are printed after unreferenced table notes.

add_footnote() is retained for compatibility only. It adds an ordinary, full-width row to the table and is soft-deprecated in favour of add_table_note().

Examples

Run this code
ht <- set_table_notes(jams, "Note: Prices exclude delivery.")
ht <- add_table_note(ht, "Source: The jam growers' association.")
table_notes(ht)
table_notes(ht) <- NULL

Run the code above in your browser using DataLab