knn_dist.factor | R Documentation |
Computes the distance between two factor vectors by converting them to character vectors.
## S3 method for class 'factor'
knn_dist(x, y)
x |
A factor vector. |
y |
A factor vector. |
This method first converts the factors to character vectors and then computes distances using stringdist::stringdist
.
A numeric vector of distances between the elements of x
and y
, calculated using stringdist::stringdist
on their character representations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.