I have a list containing N
dataframes. For this question we look at N=3
for simplicity,
asd<-list()
asd[[1]]<-data.frame("one"=c(1:3), "two"=c("a","b","c"))
asd[[2]]<-data.frame("one"=c(3:5), "two"=c("c","b","a"))
asd[[3]]<-data.frame("one"=c(5:7), "two"=c("a","b","c"))
I'd like to compare these dataframes to each other and get a N x N
matrix out whose entries (i,j)
tell me how many rows are identical between data frame i
and j
.
So, for the above we get a 3x3 matrix with elements (i,j)
(1,1)=(2,2)=(3,3) 3 (3 rows are identical)
(1,2)=(2,1) 1 (1 row is identical)
(1,3)=(3,1) 0 (0 rows are identical)
(2,3)=(3,2) 1 (0 row is identical)
Which function can I use for this in R?