matrix_form: Transform 'rtable' to a list of matrices which can be used...

matrix_formR Documentation

Transform rtable to a list of matrices which can be used for outputting

Description

Although 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.

Usage

matrix_form(
  obj,
  indent_rownames = FALSE,
  expand_newlines = TRUE,
  indent_size = 2,
  fontspec = NULL,
  col_gap = NULL
)

## S4 method for signature 'MatrixPrintForm'
matrix_form(
  obj,
  indent_rownames = FALSE,
  expand_newlines = TRUE,
  indent_size = 2,
  fontspec = NULL,
  col_gap = NULL
)

Arguments

obj

(ANY)
object to be transformed into a ready-to-render form (a MatrixPrintForm object).

indent_rownames

(flag)
if TRUE, the row names column in the strings matrix of obj will have indented row names (strings pre-fixed).

expand_newlines

(flag)
whether the generated matrix form should expand rows whose values contain newlines into multiple 'physical' rows (as they will appear when rendered into ASCII). Defaults to TRUE.

indent_size

(numeric(1))
number of spaces to be used per level of indent (if supported by the relevant method). Defaults to 2.

fontspec

(font_spec)
a font_spec object specifying the font information to use for calculating string widths and heights, as returned by font_spec().

col_gap

(numeric(1))
the gap to be assumed between columns, in number of spaces with font specified by fontspec.

Value

A MatrixPrintForm classed list with an additional nrow_header attribute indicating the number of pseudo "rows" the column structure defines, with the following elements:

strings

The content, as it should be printed, of the top-left material, column headers, row labels, and cell values of tt.

spans

The column-span information for each print-string in the strings matrix.

aligns

The text alignment for each print-string in the strings matrix.

display

Whether each print-string in the strings matrix should be printed or not.

row_info

The data.frame generated by basic_pagdf().


formatters documentation built on Sept. 13, 2024, 1:10 a.m.