[Solved] Find duplicate registers in R [closed]


Assuming the “df” dataframe has the relevant variables under the names “channel” and “email”, then:

To get the number of unique channel-email pairs:

dim(unique(df[c("channel", "email")]))[1]

To get the sum of all channel-email observations:

sum(table(df$channel, df$email))

To get the number of duplicates, simply subtract the former from the later:

sum(table(df$channel, df$email)) - dim(unique(df[c("channel", "email")]))[1]

0

solved Find duplicate registers in R [closed]