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

2018-11-19 Thread Fox, John
milton, Ontario, Canada Web: socialsciences.mcmaster.ca/jfox/ > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut > Krueger > Sent: Monday, November 19, 2018 9:42 AM > To: r-help@r-project.org >> r-help mailing list > Subject: [R]

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

2018-11-19 Thread Rui Barradas
Hello, Try i <- !(duplicated(Dup) | duplicated(Dup, fromLast = TRUE)) Dup[i] or in one line, I post it like this to make it more clear. Hope this helps, Rui Barradas Às 14:41 de 19/11/2018, Knut Krueger escreveu: It should be simple but i do not find the right keywords: Dup = 

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

2018-11-19 Thread PIKAL Petr
Hi and maybe sloightly less complicated setdiff(Dup,Dup[duplicated(Dup)]) Cheers Petr > -Original Message- > From: R-help On Behalf Of Knut Krueger > Sent: Monday, November 19, 2018 3:42 PM > To: r-help@r-project.org >> r-help mailing list > Subject: [R] unique()

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

2018-11-19 Thread PIKAL Petr
Hi Dup %in% Dup[duplicated(Dup)] Dup[!(Dup %in% Dup[duplicated(Dup)])] Cheers Petr > -Original Message- > From: R-help On Behalf Of Knut Krueger > Sent: Monday, November 19, 2018 3:42 PM > To: r-help@r-project.org >> r-help mailing list > Subject: [R] unique() d

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

2018-11-19 Thread Knut Krueger
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