Construct a cell value and associate formatting, labeling, indenting, and column spanning information with it.
rcell(
x,
format = NULL,
colspan = 1L,
label = NULL,
indent_mod = NULL,
footnotes = NULL,
align = NULL,
format_na_str = NULL,
stat_names = NULL
)non_ref_rcell(
x,
is_ref,
format = NULL,
colspan = 1L,
label = NULL,
indent_mod = NULL,
refval = NULL,
align = "center",
format_na_str = NULL
)
An object representing the value within a single cell within a populated table. The underlying structure of this object is an implementation detail and should not be relied upon beyond calling accessors for the class.
(ANY
)
cell value.
(string
or function
)
the format label (string) or formatters
function to apply to x
.
See formatters::list_valid_format_labels()
for currently supported format labels.
(integer(1)
)
column span value.
(string
or NULL
)
label. If non-NULL
, it will be looked at when determining row labels.
(numeric
)
modifier for the default indent position for the structure created by this
function (subtable, content table, or row) and all of that structure's children. Defaults to 0, which
corresponds to the unmodified default behavior.
(list
or NULL
)
referential footnote messages for the cell.
(string
or NULL
)
alignment the value should be rendered with. Defaults to "center"
if
NULL
is used. See formatters::list_valid_aligns()
for all currently supported alignments.
(string
)
string which should be displayed when formatted if this cell's value(s)
are all NA
.
(character
or NA
)
names for the statistics in the cell. It can be a vector of strings.
If NA
, statistic names are not specified.
(flag
)
whether function is being used in the reference column (i.e. .in_ref_col
should be
passed to this argument).
(ANY
)
value to use when in the reference column. Defaults to NULL
.
non_ref_rcell
provides the common blank for cells in the reference column, this value otherwise, and should
be passed the value of .in_ref_col
when it is used.
rcell(1, format = "xx.x")
rcell(c(1, 2), format = c("xx - xx"))
rcell(c(1, 2), stat_names = c("Rand1", "Rand2"))
Run the code above in your browser using DataLab