[R] unique() duplicate() not what i am looking for

Knut Krueger rhelp @ending from krueger-f@mily@de
Mon Nov 19 15:41:59 CET 2018


It should be simple but i do not find the right keywords:


Dup =  c(1,2,3,4,1,2,3,5)

I need 4,5 as result

unique(Dup) gives me [1] 4 1 2 3 5

duplicated(Dup) gives me
[1] FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE FALSE

I need
[1] TRUE TRUE TRUE FALSE  TRUE  TRUE  TRUE FALSE


Kind regards Knut



More information about the R-help mailing list