range_function_cat {psHarmonize} | R Documentation |
Possible values for categorical variables. To be called by harmonization function.
Description
Possible values for categorical variables. To be called by harmonization function.
Usage
range_function_cat(
data = temp_dataset,
possible_vals_cat = possible_vals,
new_var = item
)
Arguments
data |
data to be modified |
possible_vals_cat |
vector of possible values |
new_var |
new variable |
Value
Returns a list with the new vector (values outside of set to NA), and the number of values set to NA.
Examples
test_data <- data.frame(val = c('a','b','j','k','c','d'))
range_function_cat(data = test_data, possible_vals_cat = c('a','b','c','d'), new_var = 'val')
[Package psHarmonize version 0.3.5 Index]