Skip to content
Prev 302231 / 398503 Next

all duplicated wanted

On Aug 3, 2012, at 09:06 , Weijia Wang wrote:

            
Something like this?

dd[ID %in% unique(ID[duplicated(ID)]),]

Let's try:
ID
 1  2  3  4  7 10 
 1  1  3  1  2  2
[1]  7  7 10  3  3  3 10

The unique() bit is really just for efficiency:
[1]  7  7 10  3  3  3 10