[R] elegant way to remove cases with many different ids

D. Alain dialvac-r at yahoo.de
Fri Jan 23 10:50:22 CET 2015

Dear R-List, 

I have nested data with cases grouped by IDs and I want to remove all cases with specific IDs. 

something like


subset(df,id== 1 | id == 3)

Having a very large dataset with many IDs to remove this solution leaves me to write quite a long list of "id == x | id == y | id == z ...". I wonder if there is a more elegant way to do this? I tried with "id = c(x,y,z)" but this did not give the proper result.

Any suggestions? Thank you!

Best wishes



	[[alternative HTML version deleted]]

More information about the R-help mailing list