Possible duplicate:
The standard way to remove multiple items from a data framework
I know in R that if you are looking for a subset of another group or matching based on id, you will use something like
subset(df1, df1$id %in% idNums1)
My question is how to do the opposite or select elements that do not match the identifier vector.
I tried to use ! but I get an error
subset(df1, df1$id !%in% idNums1)
I think my backup should do something like this:
matches <- subset(df1, df1$id %in% idNums1) nonMatches <- df1[(-matches[,1]),]
but I hope that there is something more efficient.
r subset
screechOwl Mar 24 2018-12-12T00: 00Z
source share