I have used adist to calculate the number of characters that differ between two strings:
adist
a <- \"Happy day\" b <- \"Tappy Pay\" adist(a,b)
You can use the following sequence of operations:
strsplit()
setdiff()
Try this:
Reduce(setdiff, strsplit(c(a, b), split = "")) [1] "H" "d"