Skip to contents

Helper function to group multiple style names together for explicit application to columns or elements. Useful when using define_cols or other functions with multiple columns and you want to either:

  • Recycle the same group of styles to all columns: labelStyleRef = f_combine("style1", "style2")

  • Create explicit one-to-one mappings: labelStyleRef = c(f_combine("s1", "s2"), f_combine("s3"), "style4")

Usage

f_combine(...)

Arguments

...

Character strings representing style names to combine

  • Each argument must be a single character string naming a style.

  • Returned object has class tfl_style_combine to signal grouped style application.

Value

Character vector with class "tfl_style_combine" containing all provided style names. This special class signals to style resolution functions that these styles should be applied together as a group (merged with last-win strategy during create_report()). The argument ORDER is semantic: for a property defined by several combined styles, the LAST argument wins — f_combine("bold", "plain") yields not-bold, f_combine("plain", "bold") yields bold.

Examples

# Combine built-in atoms for recycling to all selected columns
spec <- create_table(mtcars) |>
  define_cols(c(mpg, cyl), labelStyleRef = f_combine("b", "fc_navy"))

# One-to-one mapping: a vector of f_combine() groups, one per column
spec2 <- create_table(mtcars) |>
  define_cols(c(mpg, cyl),
    labelStyleRef = c(f_combine("b", "i"), f_combine("fc_red"))
  )