knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

1. Table format: tfrmt()

The table format ("tfrmt") object is the most fundamental building block in tfrmt. tfrmt is a way to predefine the non-data components of your tables and how the data will be handled once added. tfrmt allows you to specify cell formats and labelling such as column headers, footnotes, etc. In addition, tfrmts can be layered.

2. Plans: *_plan()

Much of the tfrmt is divided into "plans" which provide the blueprint for how the table will look. These plans are as follows:

Additional features that use this system:

3. Structures: *_structure()

The structure objects are for defining how the location of where a specific styling should be applied. Within a plan, one or more structures may be provided. Each structure specifies the layers within a plan. For example, in the body plan, each "frmt_structure" object defines how a set of values (e.g., all "p-values") should be formatted. Structures are primarily row-oriented, and can range from broad (e.g., apply to all relevant rows in the data) to specific (e.g., apply to all relevant rows within a specific grouping value). The one exception to this is col_style_structure, which specifies the colwise styling.

In the figure below, each colour represents a different format structure (frmt_structure) to be passed in the table body plan (body_plan).

The following structures are available:

4. Elements element_*() and Formats: frmt_*()

The element and format objects are for defining the aesthetics of the table. Inspired by ggplot2, elements provide a mechanism for performing aesthetic modifications such as numeric rounding (frmt()) or the positioning of group labels (element_row_grp_loc). These are passed through structure objects.



GSK-Biostatistics/tlang documentation built on Dec. 11, 2024, 11:16 a.m.