dist_cosine | R Documentation |
A function for computing cosine distances.
dist_cosine(x, diag = FALSE, upper = FALSE)
dist_cos(x, diag = FALSE, upper = FALSE)
x |
A numeric matrix (containing coordinates). |
diag |
Logical specifying whether the diagonal of the resulting distance matrix should be printed. |
upper |
Logical specifying whether the upper triangle of the resulting distance matrix should be printed. |
The cosine distance equals 1 - the cosine similarity.
A distance matrix.
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
stringsAsFactors = FALSE)
lsa_SndT_Fra <- fast_lsa(SndT_Fra)
dist_cosine(lsa_SndT_Fra$pos1[, 1:7])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.