View source: R/range_function.R
range_function_cat | R Documentation |
Possible values for categorical variables. To be called by harmonization function.
range_function_cat(
data = temp_dataset,
possible_vals_cat = possible_vals,
new_var = item
)
data |
data to be modified |
possible_vals_cat |
vector of possible values |
new_var |
new variable |
Returns a list with the new vector (values outside of set to NA), and the number of values set to NA.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.