test_range {qualitycontrol}R Documentation

Test the range of a variable on a dataset

Description

Test the range of a variable on a dataset

Usage

test_range(
  data,
  variable,
  type,
  categories = NULL,
  lower_value = NULL,
  upper_value = NULL
)

Arguments

data

data to be tested.

variable

The variable to be tested.

type

String such as 'categorical', 'date' or 'numeric'

categories

Only to be filled if type is 'categorical'. String of categories.

lower_value

Only to be filled if type is 'numeric' or 'date'. Can be numeric or string.

upper_value

Only to be filled if type is 'numeric' or 'date'. Can be numeric or string.

Value

A data frame containing all the findings regarding the applied test.

Examples

test_range(als_data, 'onset', c('bulbar','respiratory', 'spinal'), type = 'categorical')
test_range(als_data, 'age_at_baseline', lower_value = 20, upper_value = 100, 
type = 'numeric')
test_range(als_data, 'age_at_onset', lower_value = 20, upper_value = 100,
type = 'numeric')
test_range(als_data, 'baseline_date', lower_value = '2000-01-01', upper_value = '2022-01-01', 
type = 'date')
test_range(als_data, 'death_date', lower_value = '2000-01-01', upper_value = '2022-01-01',
 type = 'date')

[Package qualitycontrol version 0.1.0 Index]