Skip to content
Prev 171574 / 398503 Next

how to NULL multiple variables of a df efficiently?

Setting to NULL works only if a single column is selected.
More generally,

df[, !(colnames(df) %in% c("var.b", "var.c")), drop=FALSE]

-Christos