Andy Andy - 6 months ago 34
R Question

How do I view all duplicates across all rows?

I am running to a problem in my database where they accidentally have duplicate stuff of the same observation where all column/variable values are exactly the same, getting duplicates for that specific observation. How do I view all of these in R so I can investigate?


Answer Source

Since you didn't give any example data, I will give a general layout.

duplicates <- duplicated(df) | duplicated(df, fromLast = TRUE) 
duplicates_set <- subset(df, duplicates == TRUE)  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download