How to combine all state names in a single vector, instead of listing all the logical exclusions separately? I found function %notin% on the CRAN website, but R doesn’t recognize is as a legitimate function.
indata <- indata[which(indata$STATE != "GU" & indata$STATE != "WY" &
indata$STATE != "KS" & indata$STATE != "ME" &
indata$STATE != "MT" & indata$STATE != "ND" &), ]
Thanks.
EDIT: @CarlWitthoft, believe it or not, I’ve actually had the following in a private package for a while
However, I never think to use it until after I’ve already typed it out the long way. Plus, using it makes my code less distributable. I was not aware of
which is only the second half of
%notin%