Skip to contents

Use a data frame, where each row represents a filter, to filter another data frame using the value of its columns.

Usage

apply_filters(df, filters)

Arguments

df

The data frame to filter. See filters_init.

filters

A data frame of filters.

Value

A filtered version of df (a subset of the rows), or NULL if all rows are removed.

See also

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