rtable to a list of matrices which can be used for outputtingAlthough rtables are represented as a tree data structure when outputting the table to ASCII or HTML,
it is useful to map the rtable to an in-between state with the formatted cells in a matrix form.
# S4 method for listing_df
matrix_form(
obj,
indent_rownames = FALSE,
expand_newlines = TRUE,
fontspec = font_spec,
col_gap = 3L,
round_type = obj_round_type(obj)
)a formatters::MatrixPrintForm object.
(ANY)
object to be transformed into a ready-to-render form (a MatrixPrintForm object).
(flag)
silently ignored, as listings do not have row names
nor indenting structure.
(flag)
this should always be TRUE for listings. We keep it
for debugging reasons.
(font_spec)
a font_spec object specifying the font information to use for
calculating string widths and heights, as returned by font_spec().
(numeric(1))
the gap to be assumed between columns, in number of spaces with
font specified by fontspec.
(string)
.
The type of rounding to perform. Allowed values: ("iec", "iec_mod" or "sas")
iec, the default, and iec_mod performs rounding compliant with IEC 60559
(see notes in round_fmt()), while
sas performs nearest-value rounding consistent with rounding within SAS.
In addition, the rounding of a negative number that rounds to zero will be presented as 0
(with the appropriate number of trailing zeros) for both sas and iec_mod,
while for iec, it will be presented as -0 (with the appropriate number of trailing zeros).
formatters::matrix_form()
lsting <- as_listing(mtcars)
mf <- matrix_form(lsting)
Run the code above in your browser using DataLab