na_percent: Percentage of NAs in a Vector or a Data Frame.

Description Usage Arguments Value See Also Examples

View source: R/na.r

Description

What percentage of NA values are in a vector or in each variable of a data frame?

Usage

1

Arguments

x

A vector or a data frame.

Value

The percentage (between 0: no NAs, and 100: all values are NAs) of the object x.

See Also

na_prop

Examples

1
2
3
4
5
6
7
8
x <- c(NA, 'a', 'b', NA, 'c')
na_percent(x)
#=> 40

df <- data.frame(x=c(1, 2), y=c(3, NA), z=c(NA, NA))
na_percent(df)
#=> x   y   z
#=> 0  50 100

lkdjiin/lkdjiinr documentation built on May 21, 2019, 7:33 a.m.