I have a dataframe with 100+ columns. Many of them contain NAs. I want not only to calculate NAs in each column but also to arrange them in descending order.
Numbers in the second column are the numbers of NAs in each column.
Rows: 1
Columns: 5
$ EXT_SOURCE_1 <int> 173378
$ EXT_SOURCE_2 <int> 660
$ EXT_SOURCE_3 <int> 60965
$ APARTMENTS_AVG <int> 156061
$ BASEMENTAREA_AVG <int> 179943
Using df %>% summarise_all(funs(sum(is.na(.)))) %>% glimpse() does a perfect job, calculating NAs in each column and putting everything in two columns, but I cannot use arrange(desc). Hence, it is tough to compare multiple columns.
Expected output:
Rows: 1
Columns: 5
$ BASEMENTAREA_AVG <int> 179943
$ EXT_SOURCE_1 <int> 173378
$ APARTMENTS_AVG <int> 156061
$ EXT_SOURCE_3 <int> 60965
$ EXT_SOURCE_2 <int> 660
I tried to used group_by() and summarise, but it works for values, not NAs.