I fear greatly that this has been asked and will be downvoted, but I have not found the answer in the docs (?"["), and discovered that it is hard to search for.
data(wines)
# This is allowed:
alcoholic <- wines[, 1]
alcoholic <- wines[, "alcohol"]
nonalcoholic <- wines[, -1]
# But this is not:
fail <- wines[, -"alcohol"]
I know of two solutions, but am frustrated for need of them.
win <- wines[, !colnames(wines) %in% "alcohol"] # snappy
win <- wines[, -which(colnames(wines) %in% "alcohol")] # snappier!