tst <- tibble::tribble(
~id, ~a, ~b, ~c, ~d,
1L, 1L, 0L, NA, NA,
2L, 0L, 1L, NA, NA,
3L, 1L, 0L, 1L, NA,
4L, 0L, 1L, 0L, NA,
5L, 1L, 0L, 0L, NA,
6L, 0L, 1L, 1L, NA,
7L, NA, 0L, 1L, NA,
8L, 0L, 1L, 1L, NA
)
tst$wt <- 1
library(tidyverse)
library(onezero)
pairwise_intersection(
data = tst,
cols = a:d,
stat = "prob",
tidy = FALSE
)
pairwise_union(
data = tst,
cols = a:d,
tidy = FALSE
)
pairwise_conditional(
data = tst,
cols = a:d,
tidy = FALSE
)
pairwise_jaccard(
data = tst,
cols = a:d,
tidy = FALSE,
stat = "index"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.