check how many na values are there in column in r
Answers
Answered by
0
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 col. The way I have come up with is following:
sapply(df$col, function(x) sum(length(which(is.na(x)))))
Is this a good/most efficient
sapply(df$col, function(x) sum(length(which(is.na(x)))))
Is this a good/most efficient
Similar questions
English,
8 months ago