Reports NA counts and percentages for each column in a data.frame, sorted by missing percentage in descending order.
Usage
diagnose_nas(.data)
# S3 method for class 'diagnose_na'
print(x, ...)Value
An S3 object of class diagnose_na containing:
- table
A data.frame with columns
variable,n_na,pct_na, andn_valid, sorted bypct_nadescending.- n_cols
Total number of columns in the input.
- n_with_na
Number of columns that have at least one NA.
See also
Other data quality:
audit_transform(),
diagnose_strings(),
get_summary_table(),
summarize_column(),
tab()
Examples
df <- data.frame(
a = c(1, NA, 3),
b = c(NA, NA, "x"),
c = c(TRUE, FALSE, TRUE)
)
diagnose_nas(df)
#>
#> ── Missing Value Diagnosis ─────────────────────────────────────────────────────
#> 2 of 3 columns have missing values
#>
#> Variable N NA Pct NA
#> ──────── ──── ──────
#> b 2 66.7%
#> a 1 33.3%