Matrix Print Form - Intermediate Representation for ASCII Table Printing
Source:R/matrix_form.R
MatrixPrintForm.Rd
Matrix Print Form - Intermediate Representation for ASCII Table Printing
Usage
MatrixPrintForm(
strings = NULL,
spans,
aligns,
formats,
row_info,
line_grouping = seq_len(NROW(strings)),
ref_fnotes = list(),
nlines_header,
nrow_header,
has_topleft = TRUE,
has_rowlabs = has_topleft,
expand_newlines = TRUE,
main_title = "",
subtitles = character(),
page_titles = character(),
main_footer = "",
prov_footer = character(),
col_gap = 3,
table_inset = 0L,
colwidths = NULL,
indent_size = 2
)
matrix_print_form(
strings = NULL,
spans,
aligns,
formats,
row_info,
line_grouping = seq_len(NROW(strings)),
ref_fnotes = list(),
nlines_header,
nrow_header,
has_topleft = TRUE,
has_rowlabs = has_topleft,
expand_newlines = TRUE,
main_title = "",
subtitles = character(),
page_titles = character(),
main_footer = "",
prov_footer = character(),
col_gap = 3,
table_inset = 0L,
colwidths = NULL,
indent_size = 2
)
Arguments
- strings
character matrix. Matrix of formatted, ready to display strings organized as they will be positioned when rendered. Elements that span more than one column must be followed by the correct number of placeholders (typically either empty strings or repeats of the value).
- spans
numeric matrix. Matrix of same dimension as
strings
giving the spanning information for each element. Must be repeated to match placeholders instrings
.- aligns
character matrix. Matrix of same dimension as
strings
giving the text alignment information for each element. Must be repeated to match placeholders instrings
. Must be a supported text alignment. See decimal_align allowed values.- formats
matrix. Matrix of same dimension as
strings
giving the text format information for each element. Must be repeated to match placeholders instrings
.- row_info
data.frame. Data.frame with row-information necessary for pagination (XXX document exactly what that is).
- line_grouping
integer. Sequence of integers indicating how print lines correspond to semantic rows in the object. Typically this should not be set manually unless
expact_newlines
is set toFALSE
.- ref_fnotes
list. Referential footnote information if applicable.
- nlines_header
numeric(1). Number of lines taken up by the values of the header (i.e. not including the divider).
- nrow_header
numeric(1). Number of rows corresponding to the header.
- has_topleft
logical(1). Does the corresponding table have 'top left information' which should be treated differently when expanding newlines. Ignored if
expand_newlines
isFALSE
.- has_rowlabs
logical(1). Do the matrices (
strings
,spans
,aligns
) each contain a column that corresponds with row labels (Rather than with table cell values). Defaults toTRUE
.- expand_newlines
logical(1). Should the matrix form generated expand rows whose values contain newlines into multiple 'physical' rows (as they will appear when rendered into ASCII). Defaults to
TRUE
- main_title
character(1). Main title as a string.
- subtitles
character. Subtitles, as a character vector.
- page_titles
character. Page-specific titles, as a character vector.
- main_footer
character(1). Main footer as a string.
- prov_footer
character. Provenance footer information as a character vector.
- col_gap
numeric(1). Space (in characters) between columns
- table_inset
numeric(1). Table inset. See
table_inset
- colwidths
numeric. NULL, or a vector of column rendering widths. if non-NULL, must have length equal to
ncol(strings)
- indent_size
numeric(1). Number of spaces to be used per level of indent (if supported by the relevant method). Defaults to 2.
Value
An object of class MatrixPrintForm
. Currently this is
implemented as an S3 class inheriting from list with the following
elements:
strings
see argument
spans
see argument
aligns
see argument
display
logical matrix of same dimension as
strings
that specifies whether an element instrings
will be displayed when the table is renderedformats
see argument
row_info
see argument
line_grouping
see argument
ref_footnotes
see argument
main_title
see argument
subtitles
see argument
page_titles
see argument
main_footer
see argument
prov_footer
see argument
col_gap
see argument
table_inset
see argument
as well as the following attributes:
nlines_header
see argument
nrow_header
see argument
ncols
number of columns of the table, not including any row names/row labels