Dear R-List, 

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

something like

df<-data.frame(id=c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5),var=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))

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

Alain 


 
 


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to