miss_frac: percentage of missings for each variable in a data.frame

Description Usage Arguments Examples

View source: R/shorthands.R

Description

This functions simply reports the number of missings as the percentage of the maximum number of rows. It also works on single variables.

Usage

1
miss_frac(df, vars = 1:NCOL(df))

Arguments

df

data.frame or variable

vars

subset of variables, defaults to all

Examples

1
2
3
4
5
6
fruits = c('apple', 'banana', NA, 'pear', 'pinapple', NA)
pets = c('cat', 'dog', 'anteater', NA, NA, NA)
favorites = data.frame(fruits, pets)
miss_frac(favorites)
miss_frac(favorites$fruits)
miss_frac(favorites, 2)

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.