Checks whether a data frame of clinical codes is correctly formatted for use
with extract_phenotypes
.
Arguments
- clinical_codes
A data frame. See
example_clinical_codes
for an example.- allow_overlapping_categories
If
TRUE
, will pass with a warning if any codes are duplicated between disease categories. IfFALSE
, an error will be raised. Default value isFALSE
.
Details
Checks that:
Expected column names are present
All columns are of type character
No missing values are present in any column
No disease categories overlap with each other i.e. each disease (for each
author
) contains a unique set of clinical codes. Overlapping disease categories may optionally be permitted by settingallow_overlapping_categories
toTRUE
Note that currently this does not check whether the clinical codes themselves are valid (i.e. whether a clinical code exists for a given coding system).
Examples
validate_clinical_codes(example_clinical_codes())