indata[!indata$STATE %in% c("GU", "WY", "KS", "ME", "MT", "ND"), ]
EDIT: @CarlWitthoft, believe it or not, I actually had the following in a private package for a while
`%notin%` <- function (x, table) x[!x %in% table]
However, I never think that I will use it until I type it in a long way. Also, using this code makes my code less accessible. I did not know about
operators:::`%!in%`
which is only the second half of %notin%
source share