On 08/08/2013 06:52 PM, Berend Hasselman wrote:

On 08-08-2013, at 10:27, Jim Lemon<j...@bitwrit.com.au>  wrote:

On 08/08/2013 04:23 PM, Kevin Parent wrote:
Well that almost works, and I didn't know about duplicated() so thanks for 
that. However, it only gives me the duplicated values. I need the original ones 
too. So the result I want is: [g,g,m,m,s,s,t,t,u,u,u,v,v,x,x,y,y,y]. What 
duplicated() gives me is [g,m,s,t,u,u,v,x,y,y]


Hi Kevin,
How about:

x[x %in% duplicated(x)]

Don't you mean this

x[x %in% x[duplicated(x)]]

Berend

Ah, yes, thanks.

Jim

______________________________________________
R-help@r-project.org mailing list
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