range_function: Range function. To be called by harmonization function.

View source: R/range_function.R

range_functionR Documentation

Range function. To be called by harmonization function.

Description

Range function. To be called by harmonization function.

Usage

range_function(
  data = temp_dataset,
  min_max_range = possible_range,
  new_var = item
)

Arguments

data

Data to be modified

min_max_range

Range of allowed values

new_var

New variable

Value

Returns a list with the new vector (values outside of range set to NA), and the number of values set to NA.

Examples


test_data <- data.frame(val = 1:10)

range_function(data = test_data, min_max_range = '[2,8]', new_var = 'val')


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