Learn R Programming

bulkreadr (version 1.2.2)

inspect_na: Summarize missingness in data frame columns

Description

inspect_na() summarizes the rate of missingness in each column of a data frame. For a grouped data frame, the rate of missingness is summarized separately for each group.

Usage

inspect_na(df)

Value

A tibble.

Arguments

df

A data frame or grouped data frame.

Details

The tibble returned contains the columns:

  • col_name: column names of df.

  • cnt: number of NA values per column.

  • pcnt: percentage of records that are NA.

For grouped data frames the group key columns appear first, followed by col_name, cnt, and pcnt. Rows are sorted by group keys (ascending) then by cnt (descending) within each group.

Examples

Run this code
inspect_na(airquality)
# Grouped dataframe summary
airquality |>
  dplyr::group_by(Month) |>
  inspect_na()

Run the code above in your browser using DataLab