stringsim computes pairwise string similarities between elements of
b, where the vector with less
elements is recycled.
stringsimmatrix computes the string similarity matrix with rows
a and columns according to
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
R object (target); will be converted by
R object (source); will be converted by
Method for distance calculation. The default is
Perform byte-wise comparison, see
Size of the q-gram; must be nonnegative. Only applies to
additional arguments are passed on to
The similarity is calculated by first calculating the distance using
stringdist, dividing the distance by the maximum
possible distance, and substracting the result from 1.
This results in a score between 0 and 1, with 1
corresponding to complete similarity and 0 to complete dissimilarity.
Note that complete similarity only means equality for distances satisfying
the identity property. This is not the case e.g. for q-gram based distances
(for example if q=1, anagrams are completely similar).
For distances where weights can be specified, the maximum distance
is currently computed by assuming that all weights are equal to 1.
stringsim returns a vector with similarities, which are values between
0 and 1 where 1 corresponds to perfect similarity (distance 0) and 0 to
NA is returned when
NA. Distances equal to
Inf are truncated to a
similarity of 0.
stringsimmatrix works the same way but, equivalent to
stringdistmatrix, returns a similarity matrix instead of a
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.