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
User rrs answer is right but that only tells you the number of NA values in the particular column of the data frame that you are passing to get the number of NA values for the whole data frame try this:
apply(, 2, function(x) {sum(is.na(x))})
This does the trick