na_diagnose: Diagnose missing value patterns in data

View source: R/na_diagnose.R

na_diagnoseR Documentation

Diagnose missing value patterns in data

Description

Provides a summary of missing values for selected columns, including the number and fraction of missing values, the number of consecutive missing runs, and the longest consecutive missing run length (in number of observations).

Usage

na_diagnose(data, cols = NULL, date_col = NULL, verbose = FALSE)

Arguments

data

A data frame or matrix containing variables to diagnose.

cols

The column indices or names of selected variables. If NULL, all numeric columns are used.

date_col

Reserved for future use; currently ignored.

verbose

Logical; if TRUE, prints progress messages.

Value

A data frame with columns: variable, n (total observations), na (number of missing values), na_frac (missing fraction), na_runs (number of consecutive missing runs), max_run (longest consecutive missing run length in number of observations).

Examples

na_diagnose(data[1:500, c(1, 4, 17:19)], cols = 3:5)

dataprep documentation built on Oct. 1, 2026, 5:07 p.m.