Learn R Programming

huxtable (version 6.0.1)

cell_note: Set notes referenced from cells

Description

cell_note is a cell property containing plain-text notes. When a huxtable is rendered, cells with notes receive reference marks and the distinct notes are printed beneath any unreferenced table_notes(). Identical note text in multiple cells receives the same mark.

Usage

cell_note(ht)

cell_note(ht) <- value

set_cell_note(ht, row, col, value)

map_cell_note(ht, row, col, fn)

Value

cell_note() returns a character matrix. The replacement function, set_cell_note() and map_cell_note() return the modified huxtable.

Arguments

ht

A huxtable.

value

A character vector or matrix. Use NA or "" for no note.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

Details

Reference marks are assigned when the huxtable is rendered, in row-major order over visible cells. Subsetting a huxtable therefore does not modify its notes. In merged ranges, only a note on the top-left visible cell is used.

HTML, LaTeX, Typst and RTF use superscript marks. Word, Excel, Markdown and screen output use bracketed marks.

Use note_symbol() to choose numeric, Roman, alphabetic or custom marks.

Examples

Run this code
ht <- hux(a = 1:2, b = 3:4)
ht <- set_cell_note(ht, 1:2, 1, "Measured value")
cell_note(ht)

Run the code above in your browser using DataLab