I have a list which contains 100 data frames. I need to find the number of identical dataframes in the list.
df1 <- data.frame(A = c(1, 1, 0, 1),
B = c(0, 0, 1, 1),
C = c(1, 1, 1, 0),
D = c(1, NA, 0, NA))
df2 <- data.frame(A = c(1, 1, 0, 1),
B = c(0, 0, 1, 1),
C = c(1, 1, 1, 0),
D = c(1, NA, NA, 0))
df3 <- data.frame(A = c(1, 1, 0, 1),
B = c(0, 0, 1, 1),
C = c(1, 1, 1, 0),
D = c(NA, 1, NA, 0))
df4 <- data.frame(A = c(1, 1, 0, 1),
B = c(0, 0, 1, 1),
C = c(1, 1, 1, 0),
D = c(NA, 1, NA, 0))
list1 <- list(df1, df2, df3, df4)
list1
As you see, df3 and df4 in the list are the same. Since the list consists of 4 objects, 6 different comparisons must be made.
If you just want to achieve grouping tags, you can simply run
match+uniquefrom base RFurther more, to distinguish the groups, you can use
spliton top of the output from above, e.g.,then filter the group(s) having more than one entries, e.g.,