powered by
An empty column is one whose only values are NA or "".
NA
drop_empties(d)
d modified by reference, invisibly.
d
data.table.
data.table
library('data.table') d = data.table(w = 3:4, x = c('', 'foo'), y = c(NA, NA), z = c(NA, '')) drop_empties(d)
Run the code above in your browser using DataLab