View source: R/string-handling.R
| str_suggest_vec | R Documentation |
Compares input string against a pool of options and returns the values of the pool that are similar to the input string.
str_suggest_vec(string, pool, max.dist = 1, n.try = 0, n.top = 5)
str_suggest_list(string, pool, max.dist = 1, n.try = 0, n.top = 5)
string |
Input string. |
pool |
Character vector that contains all valid options. |
max.dist |
Numeric value. The maximum distance a string of the pool may have to be included in the suggestions. |
n.try |
Numeric value. The number of times the search for suggestions
is repeated with |
n.top |
Numeric value. The n best suggestions in terms of string distance to input string that are returned. |
out.fail |
The output value if no suggestions can be made. |
str_suggest_vec() returns a character vector of suggestions. Is
of length 0 if no suggestions can be made. str_suggest_list() returns
a named list of length equal to length of string. Each slot carries
suggestions of one element of the input for string.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.