The fmt_passthrough() function

Let’s use the exibble dataset to create a single-column gt table (with only the char column). Now we can pass the data in that column through the ‘non-formatter’ that is fmt_passthrough(). While the function doesn’t do any explicit formatting it has a feature common to all other formatting functions: the pattern argument. So that’s what we’ll use in this example, applying a simple pattern to the non-NA values that adds an "s" character.

exibble |>
  dplyr::select(char) |>
  gt() |>
  fmt_passthrough(
    rows = !is.na(char),
    pattern = "{x}s"
  )
char
apricots
bananas
coconuts
durians
NA
figs
grapefruits
honeydews