This may be a very stupid newbie question, but as the title says, I am looking for a rank correlation coefficient that takes into account the presence of different elements in two rankings. I have tried Spearman's ρ and Kendall's τ, but in both cases, when I calculate rank correlation between the following two vectors in R, I get a coefficient of 1.
var1 <- c("a","b","c")
var2 <- c("a","b","d")
What I'd be interested in is a value that also expresses the fact that element 3 in the two vectors is different. Maybe I'm missing the obvious solution or this is simply something that would need two metrics rather than a single one. Any hints would be appreciated.
EDIT: thanks to user mic I moved from correlation to similarity and found a bunch of useful papers; https://ragrawal.wordpress.com/2013/01/18/comparing-ranked-list/ has a great discussion and Python implementation of a particular measure called "rank biased overlap". Problem solved!