filter_cat: Filter data by levels of categorical variables
Description
This function filters a dataframe or survey design object by keeping only
the rows where a specified categorical variable matches one of the given
levels. The resulting filtered dataframe is returned, along with the
tidyverse code used to generate it.
Usage
filter_cat(data, var, levels)
Value
A filtered dataframe with the tidyverse code attached.
Arguments
data
A dataframe or survey design object to be filtered.