Filter data frame rows based on values in vector

cool way is to use Negate function to create new one:

`%ni%` <- Negate(`%in%`) 

than you can use it to find not intersected elements


I think for that you want:

m[!m$date %in% c("01/31/11","01/30/11"),]

nzcoops is spot on with his suggestion. I posed this question in the R Chat a while back and Paul Teetor suggested defining a new function:

`%notin%` <- function(x,y) !(x %in% y) 

Which can then be used as follows:

foo <- letters[1:6]

> foo[foo %notin% c("a", "c", "e")]
[1] "b" "d" "f"

Needless to say, this little gem is now in my R profile and gets used quite often.