
In this following example Id 4 is duplicated with Id 1.
Like this I want both Ids (Duplicated and Duplicated with). Can anyone help?

df <- data.frame(
    "Publication" = c(1, 2, 3, 1, 4, 5, 2, 3),
    "Reference"   = c("a", "b", "c", "a", "d", "e", "b", "c"),
    "Id"= c(1, 2, 3, 4, 5, 6, 7, 8)
                 )

key <- paste(df$Publication, df$Reference, sep="_")
df.key <- cbind(key, df)
Duplicated.ids <- df.key[duplicated(df.key$key), c("Id")]


________________________________
Notice: The information contained in this electronic mail message is intended only for the use of the designated recipient. This message is privileged and confidential. and the property of GVK BIO or its affiliates and subsidiaries. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone +91-40-66929999<tel:%2B91-40-66929999> and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).

	[[alternative HTML version deleted]]

