range_function_cat: Possible values for categorical variables. To be called by...

View source: R/range_function.R

range_function_catR 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')


psHarmonize documentation built on April 4, 2025, 1:50 a.m.