r - Determine the number of NA values in a column -


i want count number of na values in data frame column. data frame called df, , name of column considering col. way have come following:

sapply(df$col, function(x) sum(length(which(is.na(x)))))   

is good/most efficient way this?

you're over-thinking problem:

sum(is.na(df$col)) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -