View source: R/intersection_powerset.R
powerset_icounts | R Documentation |
This function computes the intersection of elements for all possible combinations of the provided sets of IDs. A typical use case is in a cohort of patients with incomplete data across multiple data types. This function helps determine how many patients have complete data for specific combinations of data types, allowing you to find the optimal combinations for analysis.
powerset_icounts(ids)
ids |
|
A tibble with columns:
set_combo
: name for combo set/vector
num_subsets
: number of subsets in the combo set
common_ids
: vector of common ids in the combo set
count
: number of common ids
library(dplyr)
ids = list(a = 1:3, b = 2:5, c = 1:4, d = 3:6, e = 2:6)
res = powerset_icounts(ids)
res |>
filter(num_subsets >= 2, count > 2) |>
arrange(desc(count), desc(num_subsets))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.