Learn R Programming

mde (version 0.2.1)

na_summary: An all-in-one missingness report

Description

An all-in-one missingness report

Usage

na_summary(df, grouping_cols = NULL, sort_by = NULL, descending = FALSE, ...)

Arguments

df

A valid R `object` for which the percentage of missing values is required.

grouping_cols

A character vector. If supplied, one can provide the columns by which to group the data.

sort_by

One of counts or percents. This determines whether the results are sorted by counts or percentages.

descending

Logical. Should missing values be sorted in decreasing order ie largest to smallest? Defaults to FALSE.

...

Arguments to other functions

Examples

Run this code
# NOT RUN {
na_summary(airquality)
# grouping
test2 <- data.frame(ID= c("A","A","B","A","B"),Vals = c(rep(NA,4),"No"),
ID2 = c("E","E","D","E","D"))
na_summary(test2,grouping_cols = c("ID","ID2"))
# sort summary
na_summary(airquality,sort_by = "percent_missing",descending = TRUE)
na_summary(airquality,sort_by = "percent_complete")

# }

Run the code above in your browser using DataLab