I have a single list that looks like this
main.list <- c("dog", "cat", "bird", "snake")
I have a bunch of equal sized comparator elements that share some, but not all, the elements in main.list
comparator.list1 <- c("dog", "cat", "bird", "crescent")
comparator.list2 <- c("dog", "lizard", "cup", "plate")
comparator.list3 <- c("lizard", "bird", "squirrel", "snake")
I want to make a list that consists of the proportion overlapping elements between all the comparator lists, and the main list. So in this case:
List Number.ofshared.elemts
comparator.list1 0.75
comparator.list2 0.25
comparator.list3 0.5
How can I do that?