Re: [R] Select Original and Duplicates

2012-09-28 Thread arun
rradas To: Adam Gabbert Cc: r-help@r-project.org Sent: Friday, September 28, 2012 4:22 PM Subject: Re: [R] Select Original and Duplicates Hello, Try the following. idx <- duplicated(df) | duplicated(df, fromLast = TRUE) df[idx, ] Note that they are returned in their original order in the

Re: [R] Select Original and Duplicates

2012-09-28 Thread Adam Gabbert
That works. Thank you! On Fri, Sep 28, 2012 at 4:22 PM, Rui Barradas wrote: > Hello, > > Try the following. > > > idx <- duplicated(df) | duplicated(df, fromLast = TRUE) > df[idx, ] > > Note that they are returned in their original order in the df. > > Hope this helps, > > Rui Barradas > > Em 28

Re: [R] Select Original and Duplicates

2012-09-28 Thread Rui Barradas
Hello, Try the following. idx <- duplicated(df) | duplicated(df, fromLast = TRUE) df[idx, ] Note that they are returned in their original order in the df. Hope this helps, Rui Barradas Em 28-09-2012 21:11, Adam Gabbert escreveu: I would like to select a all the duplicate rows of a data fra

[R] Select Original and Duplicates

2012-09-28 Thread Adam Gabbert
I would like to select a all the duplicate rows of a data frame including the original. Any help would be much appreciated. This is where I'm at so far. Thanks. #Sample data frame: df <- read.table(header=T, con <- textConnection(' label value A 4 B 3 C 6 B 3