Skip to content
Prev 305146 / 398506 Next

Identifying duplicate rows?

Hello,

Please use dput(dfA) to post your data examples. The following is it's 
output. All one has to do is to copy and paste to an R session to get 
the data example.

dfA <-
structure(list(Site = c(929L, 929L, 930L, 930L, 931L, 932L),
State = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "VA", class = 
"factor"),
Value = c(73L, 73L, 76L, 76L, 74L, 75L)), .Names = c("Site",
"State", "Value"), class = "data.frame", row.names = c(NA, -6L))

# Now use the argument 'fromLast'
dfA$dups <- duplicated(dfA) | duplicated(dfA, fromLast = TRUE)

Hope this helps,

Rui Barradas

Em 10-09-2012 19:23, kborgmann escreveu: