Skip to contents

[Stable]

count_na() counts the amount of NA values in a vector.

Usage

count_na(x)

Arguments

x

An atomic object of any type.

Value

An integer number with the amount of NA values in x.

See also

Other vector functions.: drop_na(), inbetween_integers()

Examples

count_na(c(1, 2, NA, 4, 5))
#> [1] 1
#> [1] 1 # Expected

count_na(c(1, 2, 3, 4, 5))
#> [1] 0
#> [1] 0 # Expected

count_na(c(NA, NA, NA, NA, NA))
#> [1] 5
#> [1] 5 # Expected