R/count_na.R
count_na.Rd
Count occurrences of NA
count_na(x, count.empty = FALSE)
A vector or string
Treat empty values (white space) as NA? Logical. Default is FALSE.
count_na(c(1,2,NA,4,NA))# 2 #> [1] 2 count_na(c(1,2,'',4,NA))# 1 #> [1] 1 count_na(c(1,2,'',4,NA),count.empty=TRUE)# 2 #> [1] 2 count_na(c(1,2,' ',4,NA),count.empty=TRUE)# 2 #> [1] 2