All relevant information about table rows (e.g. indentations) is summarized in a data.frame
.
This function works only on rtables
and rlistings
objects, and not on their print
counterparts
(like MatrixPrintForm
).
make_row_df(
tt,
colwidths = NULL,
visible_only = TRUE,
rownum = 0,
indent = 0L,
path = character(),
incontent = FALSE,
repr_ext = 0L,
repr_inds = integer(),
sibpos = NA_integer_,
nsibs = NA_integer_,
max_width = NULL,
fontspec = font_spec(),
col_gap = 3L
)# S4 method for MatrixPrintForm
make_row_df(
tt,
colwidths = NULL,
visible_only = TRUE,
rownum = 0,
indent = 0L,
path = character(),
incontent = FALSE,
repr_ext = 0L,
repr_inds = integer(),
sibpos = NA_integer_,
nsibs = NA_integer_,
max_width = NULL,
fontspec = font_spec(),
col_gap = mf_colgap(tt) %||% 3L
)
A data.frame
of row/column-structure information used by the pagination machinery.
(ANY
)
object representing the table-like object to be summarized.
(numeric
)
internal detail, do not set manually.
(flag
)
should only visible aspects of the table structure be reflected
in this summary. Defaults to TRUE
. May not be supported by all methods.
(numeric(1)
)
internal detail, do not set manually.
(integer(1)
)
internal detail, do not set manually.
(character
)
path to the (sub)table represented by tt
. Defaults to character()
.
(flag
)
internal detail, do not set manually.
(integer(1)
)
internal detail, do not set manually.
(integer
)
internal detail, do not set manually.
(integer(1)
)
internal detail, do not set manually.
(integer(1)
)
internal detail, do not set manually.
(numeric(1)
or NULL
)
maximum width for title/footer materials.
(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
.
When visible_only
is TRUE
(the default), methods should return a data.frame
with exactly one
row per visible row in the table-like object. This is useful when reasoning about how a table will
print, but does not reflect the full pathing space of the structure (though the paths which are given
will all work as is).
If supported, when visible_only
is FALSE
, every structural element of the table (in row-space)
will be reflected in the returned data.frame
, meaning the full pathing-space will be represented
but some rows in the layout summary will not represent printed rows in the table as it is displayed.
Most arguments beyond tt
and visible_only
are present so that make_row_df
methods can call
make_row_df
recursively and retain information, and should not be set during a top-level call.
# Expected error with matrix_form. For real case examples consult {rtables} documentation
mf <- basic_matrix_form(iris)
# make_row_df(mf) # Use table obj instead
Run the code above in your browser using DataLab