I'm using the package stringdist to compare some vectors of strings but I keep getting a different answer than what I think I should when I try to test out the package.
I want to do this:
stringsim('PANDIAN', 'PANIAN', method="lv")
[1] 0.8571429
To 2 columns in a dataframe
stringsim(testdf.lv$Last[1], testdf.lv$matchedname[1], method="lv")
But I get this error:
Error in UseMethod("lengths") :
no applicable method for 'lengths' applied to an object of class "factor"
I need to be able to do this because ideally, I would replace the row numbers with an i and run it in a loop. Is this even possible? I tried looking for similar errors but the other questions were not very helpful.