na_prop: Proportion of NAs in a Vector or a Data Frame.

Description Usage Arguments Value See Also Examples

View source: R/na.r

Description

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

Usage

1

Arguments

x

A vector or data frame.

Value

The proportion between 0 (no NAs) and 1 (all values are NAs) of the object x.

See Also

na_percent

Examples

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

df <- data.frame(x=c(1, 2), y=c(3, NA), z=c(NA, NA))
na_prop(df)
#=>   x   y   z
#=> 0.0 0.5 1.0

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