| lev_distance | R Documentation | 
Uses stringdist::stringdistmatrix() to compute a range of
string distance metrics.
lev_distance(a, b, pairwise = TRUE, useNames = TRUE, ...)
| a,b | The input strings | 
| pairwise | Boolean. If  | 
| useNames | Boolean. Use input vectors as row and column names? | 
| ... | Additional arguments to be passed to  | 
A numeric scalar, vector or matrix depending on the length of the inputs. See "Details".
This is a thin wrapper around stringdist::stringdistmatrix() and mainly exists to coerce the
output into the simplest possible format (via lev_simplify_matrix()).
The function will return the simplest possible data structure permitted by the length of the
inputs a and b. This will be a scalar if a and b are length 1, a vector if either (but
not both) is length > 1, and a matrix otherwise.
In addition to useNames stringdist::stringdistmatrix() provides a range of options to control
the matching, which can be passed using .... Refer to the stringdist documentation for more
information.
lev_distance("Bilbo", "Frodo")
lev_distance("Bilbo", c("Frodo", "Merry"))
lev_distance("Bilbo", c("Frodo", "Merry"), useNames = FALSE)
lev_distance(c("Bilbo", "Gandalf"), c("Frodo", "Merry"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.