Find columns with all missing values

后端 未结 8 459
Happy的楠姐
Happy的楠姐 2020-12-09 08:42

I am writing a function, which needs a check on whether (and which!) column (variable) has all missing values (NA, ). The following is fr

8条回答
  •  攒了一身酷
    2020-12-09 09:07

    sapply(b,function(X) sum(is.na(X))
    

    This will give you the count of na in each column of the dataset and also will give 0 if there is no na present in the column

提交回复
热议问题