This class is used to define the format of columns in tables, including the name, header, latex representation, and a formatter function.
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
#>
#> ── column_format ──
#>
#> # A tibble: 1 × 4
#> name header latex formatter
#> <chr> <chr> <chr> <list>
#> 1 R2 *R*^2^ $R^2$ <fn>
R2@header
#> [1] "*R*^2^"
R2@formatter
#> function (x, accuracy = the$accuracy, ...)
#> {
#> align_chr(x, accuracy = accuracy, trim_leading_zeros = TRUE,
#> ...)
#> }
#> <environment: 0x563e7ba0b628>