Re: [R] counting matches in two vectors

2014-01-23 Thread M.Bezabih
Many thanks, Arun. Res 1 is exactly what I wanted. Mintewab -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of arun Sent: 23 January 2014 16:27 To: R help Subject: Re: [R] counting matches in two vectors Hi, May be this helps:  z1 <

[R] counting matched elements in two vectors

2014-01-23 Thread M.Bezabih
Hi all, I have the following reproducible example z<-c(-5:40) w<-c(11, 11, 12, 14, 14, 14, 15, 16, 18, 25, 26, 26, 26, 27, 27, 30) r<-z %in% w now r gives me the presence or absence of elements in z that are in w but I am interested in getting the number of times each element in z appears (o