This function checks whether the percentage of missing values in a dataset matches the documented percentage in a metadata reference. It warns if there are significant discrepancies.

assert_missing_values(data, metadata)

Arguments

data

A data frame. The dataset to check for missing values.

metadata

A data frame. Metadata containing expected missing value percentages and valid value counts. It must include the columns raw_field_name, percentage_of_missing_values, count_of_valid_values, and preferred_field_name.

Value

No return value. The function issues warnings if the actual missing value percentages deviate significantly from the documented values.