The technique that I usually use is fairly stable and relatively insensitive to ordering, punctuation, etc. It is based on objects called "n-grams." If n = 2, "bigrams". For instance:
"Adrian Bruce" --> ("Ad","dr","ri","ia","an","n "," B","Br","ru","uc","ce") "Bruce Adrian" --> ("Br","ru","uc","ce","e "," A","Ad","dr","ri","ia","an")
Each line has 11 bigrams. 9 of them are common. Thus, the similarity score is very high: 9/11 or 0.818, where 1.000 is a perfect match.
I am not very familiar with R, but if the package does not exist, this method is very easy to code. You can write code that goes through the bigrams of line 1 and counts how many of them are in line 2.
source share