Removes columns that contain only NA values from a data.table.
Columns listed in excl_cols are retained even if they are empty.
Usage
remove_empty_columns(df, excl_cols = NULL, ...)
Value
A data.table containing all original non-empty columns, plus any
columns listed in excl_cols, regardless of whether they are empty.
Columns that contain only NA values and are not explicitly preserved
are removed from the output.
Arguments
df
A data.table from which empty columns should be removed.
excl_cols
Optional character vector of column names that must be preserved,
even if all values in those columns are missing.