I want to count the number of NA values in a data frame column. Say my data frame is called df, and the name of the column I am considering is
NA
df
This form, slightly changed from Kevin Ogoros's one:
na_count <-function (x) sapply(x, function(y) sum(is.na(y)))
returns NA counts as named int array