To delete single columns, I'll just use dat$x <- NULL
.
To delete multiple columns, but less than about 3-4, I'll use dat$x <- dat$y <- dat$z <- NULL
.
For more than that, I'll use subset
, with negative names (!):
subset(mtcars, , -c(mpg, cyl, disp, hp))