percent_empty: Percent of values in a vector that are NA

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Takes a vector and calculates the percent of values that are NA

Usage

1

Arguments

x

Vetor of values

Value

Percent of values in x that are NA

Examples

1
2
3
4
5
6
percent_empty(c(1,2,NA,4))

# Use with purrr to test columns in matrix, dataframe etc.

nadf <- data.frame(x = rep(NA, 3), y = c(1, 2, NA))
purrr::map_dbl(nadf, ~ percent_empty(.))

AndBooth/Rutils documentation built on May 28, 2019, 11:04 a.m.