Use a data frame, where each row represents a filter, to filter another data frame using the value of its columns.
Arguments
- df
The data frame to filter. See filters_init.
- filters
A data frame of filters.
See also
filters_init for the filters table.
add_filter()
,edit_filter()
andremove_filter()
to manipulate the filters table.
Examples
data <- tibble::tibble(
x = 1:10,
y = "a"
)
filters <- add_filter(filters_init, "x", data)
filters <- edit_filter(filters, 1, min = 1, max = 5)
apply_filters(data, filters)
#> # A tibble: 5 × 2
#> x y
#> <int> <chr>
#> 1 1 a
#> 2 2 a
#> 3 3 a
#> 4 4 a
#> 5 5 a