Description Usage Arguments Details Value Constraints See Also Examples
compute distance metrics between strings.
1 2 3 |
a |
character or FLVector of characters |
b |
character or FLVector of characters |
method |
can be |
weight |
for method=nmw, weights and penalties for match, mismatch and gaps, integer weights for matching sequential(d), nonmatching non-sequential characters(i) between the strings, and integer penality for gaps(s) (ideally negative). |
p |
penality factor for jaro-winkler if p==0 jaro distance is computed |
caseFlag |
logical or 0/1 indicating if comparision should be case sensitive |
vlength |
optional, length of strings to compare used for hamming |
... |
This function computes pairwise string distances between elements of a and b, where the argument with less elements is recycled.
The following distance metrics are supported: lv: Levenshtein, calling FLLevenshteinDist; dl: Levenshtein-Damerau, calling FLDLevenshteinDist; hamming: Hamming, calling FLHammingDist; jaccard: Jaccard, calling FLHammingDist; j, p==0: Jaro, calling FLJaroDist; j, p>0: Jaro-Winkler, calling FLJaroWinklerDist; nmw: Needleman-Wunsch, calling FLNeedleManWunschDist.
FLVector if any a
or b
is R character of length 1. Otherwise returns a FLMatrix.
row vectors are not supported currently.
Output is slightly different from stringdist::stringdist.
Refer to @return
section.
stringdist
for R function reference
implementation.
1 2 3 4 5 6 7 | widetable <- FLTable("iris", "rownames")
flv <- widetable[1:10,"Species"]
resultflvector <- stringdist("xyz",flv)
resultflvector <- stringdist("xyz",flv,method="lv",caseFlag=1)
resultflvector <- stringdist("xyz",flv,method="hamming",vlength=4)
resultflvector <- stringdist(flv,flv,method="jw",p=1)
resultflvector <- stringdist(c("xyz","poli"),flv,method="jw")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.