Find columns with all missing values

后端 未结 8 462
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:00

    To find the columns with all values missing

     allmisscols <- apply(dataset,2, function(x)all(is.na(x)));  
     colswithallmiss <-names(allmisscols[allmisscols>0]);    
     print("the columns with all values missing");    
     print(colswithallmiss);
    

提交回复
热议问题