Returns a transform that replaces a specific value with NA. Commonly
used to convert empty strings to NA before comparison so that
missing-data levels are triggered correctly. The result can be passed
as the transform argument to il_compare() or il_block_on(), and
composed with other transforms via il_transform(). On DuckDB and
PostgreSQL, maps to SQL NULLIF.
Examples
tf <- il_nullif('')
tf(c('New York', '', 'Chicago'))
#> [1] "New York" NA "Chicago"
# Use before comparison to treat blank city as missing
spec <- il_spec() |>
il_compare(city, cl_exact(), transform = il_nullif(''))
