powerset_icounts {usefun}R Documentation

Powerset Intersection Table

Description

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.

Usage

powerset_icounts(ids)

Arguments

ids

list()
A named list, each element being a numeric vector of ids.

Value

A tibble with columns:

Examples

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))


[Package usefun version 0.5.2 Index]