check_CCAPS: Check CCAPS item values

View source: R/check_CCAPS.R

check_CCAPSR Documentation

Check CCAPS item values

Description

A function used to check the validity of the CCAPS items. All CCAPS items should have values between 0 and 4, and possibly NA for missing values. This function checks whether these constraints are satisfied, and if not, returns a vector containing the CCAPS item(s) which violated these rules.

Usage

check_CCAPS(dat)

Arguments

dat

The data frame containing the new year of (combined) data.

Value

A vector of strings containing the names of the CCAPS variables that have at least one value out of bounds. If no variables have values out of bounds, the returned value will be NULL.

Note

CCAPSvalue_check calls on first and last CCAPS items–CCAPS_01 and CCAPS_70 –by name, so they must be named properly in dat. Variable naming convention is CCAPS_01, CCAPS_70. If dat does not contain the proper CCAPS variable names (or the naming convention was changed in the new year's data), the function will return an error. In addition, it is assumed that all CCAPS variables exist between CCAPS_01 and CCAPS_70.


CCMH-PSU/CCMHr documentation built on Jan. 31, 2024, 1:08 a.m.