Show columns with NAs in a data.frame

后端 未结 3 1790
甜味超标
甜味超标 2021-02-01 05:57

I\'d like to show the names of columns in a large dataframe that contain missing values. Basically, I want the equivalent of complete.cases(df) but for columns, not rows. Some o

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 06:38

    Here is one way:

    colnames(tmp)[colSums(is.na(tmp)) > 0]
    

    Hope it helps,

    Manoel

提交回复
热议问题