powered by
Range function. To be called by harmonization function.
range_function( data = temp_dataset, min_max_range = possible_range, new_var = item )
Returns a list with the new vector (values outside of range set to NA), and the number of values set to NA.
Data to be modified
Range of allowed values
New variable
test_data <- data.frame(val = 1:10) range_function(data = test_data, min_max_range = '[2,8]', new_var = 'val')
Run the code above in your browser using DataLab