Description Usage Arguments Details References Examples
Matches of character strings
1 | GetCloseMatches(string = NULL, sequence_strings = NULL, n = 3L, cutoff = 0.6)
|
string |
a character string. |
sequence_strings |
a vector of character strings. |
n |
an integer value specifying the maximum number of close matches to return; n must be greater than 0. |
cutoff |
a float number in the range [0, 1], sequence_strings that don't score at least that similar to string are ignored. |
Returns a list of the best "good enough" matches. string is a sequence for which close matches are desired (typically a string), and sequence_strings is a list of sequences against which to match string (typically a list of strings).
https://www.npmjs.com/package/difflib, http://stackoverflow.com/questions/10383044/fuzzy-string-comparison
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | try({
if (reticulate::py_available(initialize = FALSE)) {
if (check_availability()) {
library(fuzzywuzzyR)
vec = c('Frodo Baggins', 'Tom Sawyer', 'Bilbo Baggin')
str1 = 'Fra Bagg'
GetCloseMatches(string = str1, sequence_strings = vec, n = 2L, cutoff = 0.6)
}
}
}, silent=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.