I have this data frame (train) where I have 2314 variables and I want to drop the columns where the unique value is 0.
Example:
So, I want to remove all the columns with 0 unique values.
> unique(train$makeAm.General)
[1] 0
And, only keep the columns where the unique value is 0 and 1
> unique(train$makeAston.Martin)
[1] 0 1