R/count.R
count_na.Rd
This function counts NAs in a data frame for each variable
count_na(data, format = "longer")
data frame
output data frame format ('longer' or 'wider')
tibble::tibble( var1 = c(1,2,3,4, NA), var2 = c(NA, NA, NaN, 2, 3) ) -> data count_na(data) #> variable n #> 1 var2 3 #> 2 var1 1 count_na(data, "wider") #> var2 var1 #> 1 3 1