percent_missing: Column-wise missingness percentages

View source: R/percent_missing.R

percent_missingR Documentation

Column-wise missingness percentages

Description

A convenient way to obtain percent missingness column-wise.

Usage

percent_missing(df, grouping_cols = NULL, exclude_cols = NULL)

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.

exclude_cols

A character vector indicating columns to exclude when returning results.

Value

An object of the same class as x showing the percentage of missing values.

Examples

test <- data.frame(ID= c("A","B","A","B","A","B","A"), 
Vals = c(NA,25,34,NA,67,NA,45))
percent_missing(test,grouping_cols = "ID")
percent_missing(airquality)
percent_missing(airquality,exclude_cols = c("Day","Temp"))

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