percent_missing {mde}R 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"))

[Package mde version 0.3.2 Index]