Skip to contents

Schema, null, and suspect-value audit

Usage

mrm_uof_data_quality_audit(df, sidecar = NULL, expected_schema = NULL)

Arguments

df

A data.frame.

sidecar

Optional list with fields (list-of-list with id and type) and optionally records, in the CKAN datastore_search response shape.

expected_schema

Optional list with a columns field carrying named entries with name and dtype.

Value

Named list with per_column, missing_columns, extra_columns, dtype_mismatches, suspect_flags.

Examples

inc <- morie_datasets_corrections_uof_incidents()
str(mrm_uof_data_quality_audit(inc), max.level = 1)
#> List of 13
#>  $ title           : chr "MRM-UOF Data Quality Audit"
#>  $ call            : chr "mrm_uof_data_quality_audit(df=<50r x 3c>)"
#>  $ summary_lines   :List of 6
#>  $ warnings        : chr(0) 
#>  $ interpretation  : chr "2 suspect-value flag(s)."
#>  $ n               : int 50
#>  $ n_rows          : int 50
#>  $ n_cols          : int 3
#>  $ per_column      :List of 3
#>  $ missing_columns : chr(0) 
#>  $ extra_columns   : chr(0) 
#>  $ dtype_mismatches: list()
#>  $ suspect_flags   : chr [1:2] "year: constant value (2023)" "incident_ID: every value unique — possible identifier"
#>  - attr(*, "class")= chr [1:3] "morie_mrm_uof_result" "morie_rich_result" "list"