I have a number of columns that I would like to remove from a data frame. I know that we can delete them individually using something like:
df$x <- NULL <
You could use %in% like this:
%in%
df[, !(colnames(df) %in% c("x","bar","foo"))]