| lss | R Documentation |
Levenshtein similarity (based on Levenshtein distance)
lss(S1, S2, normalize = TRUE)
S1 |
character of length 1 or longer, contains the sequence |
S2 |
character of length 1 or longer, contains the sequence |
normalize |
logical, should the distance measure be normalized (by default: |
we use the adist function, and normalize it according to 1-d(S1, S2) / max(S1l, S2l), where D is the adist function and S1l and S2l are the lengths of the two sequences
numeric value of Levenshtein similarity
S1 <- "AAAABBAAAC"
S2 <- "ABAABBBAAA"
lss(S1, S2)
lss(S1, S1)
## Not run:
RecordLinkage::levenshteinSim(S1, S2)
## End(Not run)
S3 <- "CBX"
lss(S1, S3)
lss(S2, S3)
# and with character vectors:
S1 <- c("one", "two", "three")
S2 <- c("eins", "two", "three")
lss(S1, S2)
lss("ABC", "DBC")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.