Supposing a data set with several rows and columns with some columns being 0 (I mean all values in the column are 0\'s). How one can filter out those columns? I have tried w
training_data[, !colSums(training_data == 0)]
Based on question update: (filter applied to columns 1 - 99)
idx <- which(as.logical(colSums(training_data[, 1:99] == 0))) # find columns training_data[, setdiff(seq_along(test_data), idx)] # exclude columns