column_format: Column format class

column_formatR Documentation

Column format class

Description

This class is used to define the format of columns in tables, including the name, header, latex representation, and a formatter function.

Usage

column_format(
  name = character(0),
  header = character(0),
  latex = character(0),
  formatter = function() NULL
)

Arguments

name

name of column

header

markdown representation of header name

latex

latex representation of header name

formatter

function that formats the column values. It should take a vector of values and return a character vector of formatted values.

Value

column_format object

Examples

R2 <- column_format(
         "R2",
         header = "*R*^2^",
         latex = "$R^2$",
         formatter = \(x, accuracy = the$accuracy, ...) {
                       align_chr(x,
                                 accuracy = accuracy,
                                 trim_leading_zeros = TRUE,
                                 ...)
                       })
R2
R2@header
R2@formatter

apa7 documentation built on May 26, 2026, 5:07 p.m.