Adds a label row at the beginning of analysis output objects, such as
CellValue, list of CellValues, or RowsVerticalSection objects.
These objects are returned by analysis functions used within the rtables
framework and are typically created via rtables::rcell() or
rtables::in_rows() functions.
This is typically used to introduce section headers (e.g., "Descriptive Statistics") in tabular or reporting outputs.
Note
If x is of class RowsVerticalSection, the attributes
row_formats, row_na_strs, and row_footnotes are not preserved.
Examples
rvs <- rtables::in_rows(Mean = rtables::rcell(5), Range = rtables::rcell(c(1, 8)))
prepend_label_cell(rvs, "Descriptive Statistics", label_indent_mod = 1L)
#> RowsVerticalSection (in_rows) object print method:
#> ----------------------------
#> row_name formatted_cell indent_mod row_label
#> 1 1 Descriptive Statistics
#> 2 Mean 5 0 Mean
#> 3 Range 1, 8 0 Range
