View source: R/pairwise_jaccard.R
pairwise_jaccard | R Documentation |
Calculates the pairwise Jaccard distance (or index).
pairwise_jaccard(data, cols, case_weights, metric = "dist")
data |
A data frame. |
cols |
Columns to analyze. |
case_weights |
An optional column of case weights. |
metric |
Metric to return, one of |
Metric: Similarity or Dissimilarity
Symmetrical: Yes
Upper Limit: 1
Lower Limit: 0
B | |||
1 | 0 | ||
A | 1 | a | b |
0 | c | d | |
Index = a/(a+b+c)
Distance = 1-Index
A matrix.
res <- pairwise_jaccard(
data = FoodSample,
cols = Bisque:Turkey,
metric = "dist"
)
print(res)
tidy(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.