Creates a single transform function that applies multiple transformations
in sequence. The first function is applied first and the last function
is applied last.
The result is itself a function that can be passed as the transform
argument to il_compare() or il_block_on().
Arguments
- ...
Two or more functions to compose, in application order. Each must be a recognized transform (e.g.
tolower,toupper,trimws, il_soundex, il_metaphone, il_dmetaphone).
Value
A function of class il_transform_chain that applies all
transforms in order. The individual steps are stored in the
"transforms" attribute.
Details
On the SQL side, the transforms are nested inside-out:
il_transform(tolower, trimws) becomes TRIM(LOWER(col)).
Examples
# Lower-case then trim whitespace
tf <- il_transform(tolower, trimws)
tf(' Hello ')
#> [1] "hello"
# Use in a specification
spec <- il_spec() |>
il_compare(name, cl_exact(), transform = il_transform(tolower, trimws))
