Suppose i have a data frame like the following:
df <- data.frame(v1 = sample(1:10, 100, replace = T), v2 = sample(LETTERS, 100, replace = T),
Clunky but it works...
x<-as.data.frame(t(apply(df,2,function(x) length(x[unique(x)]))>10)) df[,names(x[,x>0])]