cosim | R Documentation |
cosim
computes the cosine similarity of two vectors.
Specify either two individual vectors or a data frame/matrix and two pertinent row names as input.
cosim(v1, v2, data = NULL)
v1 |
Either an individual vector or a row name of |
v2 |
Either an individual vector or a row name of |
data |
A data frame object or matrix. |
D. Schmitz
### two individual vectors var01 <- runif(n = 50, min = 1, max = 10) var02 <- runif(n = 50, min = 1, max = 10) cosim(var01, var02) ### data frame data("gdsm_df") cosim("var03", "var04", gdsm_df) ### matrix data("gdsm_mat") cosim("var05", "var06", gdsm_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.