evaluateStandard {safetyGraphics} | R Documentation |
Evaluate a data set against a data standard
Description
Determines whether the required data elements in a data standard are found in a given data frame
Usage
evaluateStandard(data, meta, domain, standard)
Arguments
data |
A data frame in which to detect the data standard |
meta |
the metadata containing the data standards. |
domain |
the domain to evaluate - should match a value of |
standard |
standard to evaluate |
Value
a list describing to what degree the data set matches the data standard. The "match" property describes compliance with the standard as "full", "partial" or "none". The "checks" property is a list of the data elements expected for the standard and whether they are "valid" in the given data set. "total_checks", "valid_checks" and "invalid_checks" provide counts of the specified checks. "match_percent" is calculated as valid_checks/total_checks. "mapping" is a data frame describing the detected standard for each "text_key"
in the provided metadata. Columns are "text_key"
, "current"
containing the name of the matched column or field value in the data and "match"
a boolean indicating whether the data matches the standard.
Examples
# Match is TRUE
evaluateStandard(
data=safetyData::adam_adlbc,
meta=safetyCharts::meta_labs,
domain="labs",
standard="adam"
)
# Match is FALSE
evaluateStandard(
data=safetyData::adam_adlbc,
meta=safetyCharts::meta_labs,
domain="labs",
standard="sdtm"
)