Produces a string with <col-name>: <col-definition> format which can be
included in a table note providing a more informative definition with the
column name. The column definition can be generated from the short name
or the label (but note that these could frequently be the same).
Usage
ys_col_note(
.spec,
...,
.unit = FALSE,
.title_case = FALSE,
.sep = ": ",
.to_string = TRUE,
.collapse = "; ",
.width = NULL,
.type = c("short", "label")
)Arguments
- .spec
a yspec object.
- ...
passed to
ys_select().- .unit
logical; if
TRUE, then append the unit surrounded by parens to the column definition.- .title_case
logical; if
TRUEthen the column definition text is passed throughtools::toTitleCase().- .sep
a string to separate column name and column definition; usually a space should be included as the terminal character (see default).
- .to_string
logical; if
TRUE, then a single string is returned.- .collapse
a string to separate items when
.to_stringisTRUE; usually a space should be included as the terminal character (see default).- .width
if
numericand.to_stringisTRUE, then the result is passed throughbase::strwrap().- .type
selects if the column definition is generated from calling
ys_get_short()orys_get_label().
