I am working in R. I have two vectors; A and B of lengths 5913 and 3733 respectively (with entries are repeated). I want to extract those values (with repetitions) that are present in both A and B. I have done (A %in% B) (lets call it C) and (B %in% A) (lets call it D). The length of C is 3906 and that of D is 3607 (so 2007 elements in A are not in B and 126 elements in B are not in A).
But How do I find the common values ? I don't think I can use intersect() method as it expects vectors with no duplicate values. I have many many repetitions.
Note: Due to the length of these vectors, I couldn't mention them here.
Any help would be greatly appreciated.