Constructor for MatrixPrintForm, an intermediate representation for ASCII table printing.
MatrixPrintForm(
strings = NULL,
spans,
aligns,
formats,
row_info,
colpaths = NULL,
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(),
listing_keycols = NULL,
main_footer = "",
prov_footer = character(),
header_section_div = NA_character_,
horizontal_sep = default_hsep(),
col_gap = 3,
table_inset = 0L,
colwidths = NULL,
indent_size = 2,
fontspec = font_spec(),
rep_cols = 0L,
round_type = valid_round_type
)An object of class MatrixPrintForm. Currently this is implemented as an S3 class inheriting
from list with the following elements:
stringssee argument.
spanssee argument.
alignssee argument.
displaylogical matrix of same dimension as strings that specifies whether an element
in strings will be displayed when the table is rendered.
formatssee argument.
row_infosee argument.
line_groupingsee argument.
ref_footnotessee argument.
main_titlesee argument.
subtitlessee argument.
page_titlessee argument.
main_footersee argument.
prov_footersee argument.
header_section_divsee argument.
horizontal_sepsee argument.
col_gapsee argument.
table_insetsee argument.
as well as the following attributes:
nlines_headersee argument.
nrow_headersee argument.
ncolsnumber of columns of the table, not including any row names/row labels
(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).
(numeric matrix)
matrix of same dimension as strings giving the
spanning information for each element. Must be repeated to match placeholders in strings.
(character matrix)
matrix of same dimension as strings giving the text
alignment information for each element. Must be repeated to match placeholders in strings.
Must be a supported text alignment. See decimal_align for allowed values.
(matrix)
matrix of same dimension as strings giving the text format
information for each element. Must be repeated to match placeholders in strings.
(data.frame)
data frame with row-information necessary for pagination (see
basic_pagdf() for more details).
(list or NULL)
NULL, or a list of paths to each leaf column,
for use during horizontal pagination.
(integer)
sequence of integers indicating how print lines correspond
to semantic rows in the object. Typically this should not be set manually unless
expand_newlines is set to FALSE.
(list)
referential footnote information, if applicable.
(numeric(1))
number of lines taken up by the values of the header
(i.e. not including the divider).
(numeric(1))
number of rows corresponding to the header.
(flag)
does the corresponding table have "top left information"
which should be treated differently when expanding newlines. Ignored if expand_newlines
is FALSE.
(flag)
do the matrices (strings, spans, aligns) each contain a
column that corresponds with row labels (rather than with table cell values). Defaults to TRUE.
(flag)
whether the matrix form generated should expand rows whose
values contain newlines into multiple 'physical' rows (as they will appear when rendered into
ASCII). Defaults to TRUE.
(string)
main title as a string.
(character)
subtitles, as a character vector.
(character)
page-specific titles, as a character vector.
(character)
. if matrix form of a listing, this contains
the key columns as a character vector.
(character)
main footer, as a character vector.
(character)
provenance footer information, as a character vector.
(string)
divider to be used between header and body sections.
(string)
horizontal separator to be used for printing divisors
between header and table body and between different footers.
(numeric(1))
space (in characters) between columns.
(numeric(1))
table inset. See table_inset().
(numeric or NULL)
column rendering widths. If non-NULL, must have length
equal to ncol(strings).
(numeric(1))
number of spaces to be used per level of indent (if supported by
the relevant method). Defaults to 2.
(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))
number of columns to be repeated as context during horizontal pagination.
(string)
The type of rounding to perform. Allowed values: ("iec", "iec_mod" or "sas")
See round_fmt() for details.
basic_matrix_form(iris) # calls matrix_form which calls this constructor
Run the code above in your browser using DataLab