sort_by_missingness: Sort Variables according to missingness

View source: R/sort_by_missingness.R

sort_by_missingnessR Documentation

Sort Variables according to missingness

Description

Provides a useful way to sort the variables(columns) according to their missingness.

Usage

sort_by_missingness(df, sort_by = "counts", descending = FALSE, ...)

Arguments

df

A data.frame object

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.

...

Other arguments to specific functions. See "See also below"

Value

A 'data.frame' object sorted by number/percentage of missing values

See Also

get_na_counts percent_missing

Examples

sort_by_missingness(airquality, sort_by = "counts")
# sort by percents
sort_by_missingness(airquality, sort_by="percents")
# descending order
sort_by_missingness(airquality, descend = TRUE)

Nelson-Gon/mde documentation built on March 23, 2022, 10:58 p.m.