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.
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,
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,
3 matches
Mail list logo