Skip to content
Prev 181545 / 398502 Next

How to exclude a column by name?

Paul Hiemstra wrote:
You don't actually need which() (and the approach runs into problems if
"a" isn't there). Just select the others:

df[, names(df) != "a"]

Or, BTW, you can use within()

aq <- within(airquality, rm(Day))