jaccard | R Documentation |
Compute Jaccard similarity between two vectors.
jaccard(x, y, ...)
x |
A dichotomous vector. |
y |
A dichotomous vector. |
... |
Currently ignored. |
A numeric value corresponding to the Jaccard similarity.
Fernando Palluzzi fernando.palluzzi@gmail.com
similarity
,
euclidean
# Sample two random ultrasound profiles from the default dataset x <- mosaic::sample(mpm.us, 1, replace = FALSE, prob = NULL) x <- as.matrix(dichotomize(x[, 2:15])) y <- mosaic::sample(mpm.us, 1, replace = FALSE, prob = NULL) y <- as.matrix(dichotomize(y[, 2:15])) # Compute the euclidean distance r <- jaccard(x, y) print(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.