I want to delete columns based on certain conditions.
library(data.table)
dt <- data.table(1:4, rep(TRUE, 4), c(TRUE, FALSE, TRUE, TRUE))
In this case I want to delete columns that are all TRUE. Output should be
# V1 V3
# 1 TRUE
# 2 FALSE
# 3 TRUE
# 4 TRUE