Math, asked by Mukulkinker1414, 1 year ago

check how many na values are there in column in r

Answers

Answered by Rahulraj000
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 

Similar questions