View source: R/cosine_similarity.R
cosine_similarity | R Documentation |
Computes cosine similarity between two vectors.
cosine_similarity(x, y)
x |
A vector of numbers. |
y |
Another vector of numbers, of the same length as x. |
x = c(3,0,0,2)
y = c(0,2,0,1)
cosine_similarity(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.