Updates a factor variable in a data frame based on specified values.
Usage
h_update_factor(df, .var, val = NULL, excl_levels = NULL)
Arguments
- df
Data frame containing the variable to update.
- .var
Variable name to update.
- val
Values to keep.
- excl_levels
Levels to exclude from the factor.
Value
Updated data frame.