Counts the elements belonging to precisely each observed combination of sets.
Elements in no set are excluded, since they have no column to sit in.
Usage
upset_intersections(m, max_n = NULL)
Arguments
- m
A logical matrix, elements x sets, with set names as column names.
- max_n
Keep only the max_n largest intersections. NULL keeps all.
Value
A list with size (integer vector), membership (logical matrix,
intersections x sets), sets, set_sizes and total.
Examples
m <- cbind(A = c(TRUE, TRUE, FALSE), B = c(TRUE, FALSE, TRUE))
upset_intersections(m)
#> $size
#> [1] 1 1 1
#>
#> $membership
#> A B
#> [1,] FALSE TRUE
#> [2,] TRUE FALSE
#> [3,] TRUE TRUE
#>
#> $sets
#> [1] "A" "B"
#>
#> $set_sizes
#> A B
#> 2 2
#>
#> $total
#> [1] 3
#>