| cossim | R Documentation |
Cosine similarity
cossim(x, y)
x |
A numeric vector |
y |
A numeric vector |
The cosine similarity between two vectors
Leydesdorff, L. (2005) Similarity Measures, Author Cocitation Analysis,and Information Theory. JASIST 56(7), pp.769-772.
Fridolin Wild (2022) lsa: Latent Semantic Analysis, R package version 0.73.3 https://CRAN.R-project.org/package=lsa
data("act_pattern")
# Calculate the cosine similarity between an activation pattern and itself
similarity <- cossim(
x = act_pattern$signal,
y = act_pattern$signal
)
# Calculate the cosine similarity between a non-negative activation pattern and its negative
similarity <- cossim(
x = act_pattern$signal,
y = -act_pattern$signal
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.