I have two vectors of strings:
a <- c('Alpha', 'Beta', 'Gamma', 'Delta')
b <- c('Epsilon', 'Zeta', 'Eta', 'Theta')
and I would like to compute the Levenshtein distance or edit distance for each pair of strings.
If I use
stringdist(a, b, method="lv")
The output is a vector with the Levenshtein distance of each string in vector a and the corresponding string in vector b (i.e., Alpha vs Epsilon, Beta vs Zeta, etc.).
What I need instead is a pairwise comparison between each string in one vector and ALL the other strings in the other vector (i.e. Alpha vs Epsilon, Alpha vs. Zeta, Alpha vs Eta, Alpha vs. Theta, Beta vs Epsilon, etc.).
Thanks