Re: [R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread T.D. Rudolph
Henrique is correct; entering duplicated(df) will return an index of TRUE or FALSE for every row. TRUE indicates a duplicated row. df[duplicated(df),] # shows which rows are repeated df[-duplicated(df),] # shows which rows are unique -- View this message in context: http://r.789695.n4.nabble.

Re: [R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread Henrique Dallazuanna
See ?duplicated On Tue, Jul 13, 2010 at 7:42 PM, david hilton shanabrook < davidshanabr...@me.com> wrote: > I wrote something to check for duplicate rows in a data frame, but it is > too inefficient. Is there a way to do this without the nested loops? > > This code correctly indicates rows 1-7,

[R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread david hilton shanabrook
I wrote something to check for duplicate rows in a data frame, but it is too inefficient. Is there a way to do this without the nested loops? This code correctly indicates rows 1-7, 1-8, 2-9 and 7-8 are duplicates. > m <- matrix(c(1,1,1,1,1, 2,2,2,2,2, 6,6,6,6,6, 3,3,3,3,3, 4,4,4,4,4, > 5,5,