Applies column filters for the duration of the supplied expression, then
restores the previous state (even on error). This is useful when you need
different filters for a group of calls without permanently changing
session state. For a single call, prefer the col_filters argument on
the query function itself (see CODES()) — it has the same semantics,
scoped to that call.
Arguments
- col_filters
The filters to apply: a type-layered list or
get_col_filters()object (each table entry replaces that table's pins/defaults wholesale), orNULL/NAfor no filtering at all.- code
Code to execute with the temporary filters. The scope covers query construction: every codeminer read made while
codeevaluates resolves against the temporary filters.
Details
Note the argument order (filters first, code last, as in
withr::with_*()): wrap the expression rather than piping into this
function.