remove all variables except some
library(gdata) > keep(a) #shows you which variables will be removed [1] "b" "c" > keep(a, sure = TRUE) # setting sure to TRUE removes variables b and c > ls() [1] "a"