Skip to contents

`from_list_to_upset_df()` copies the functionality of UpSetR::fromList() and converts a list of named vectors to an upset plot compatible data frame. It modifies the original function to return a data frame with row names that record the identity of the items in each vector. This allows additional metadata to be joined to the resultant data frame using the values of the items in the list.

Usage

from_list_to_upset_df(upset_list)

Arguments

upset_list

A named list of vectors. Each name should be one set and each vector to should contain the values to be intersected.

Value

A data.frame.

Examples

sample1 <- c("a", "b", "c")
sample2 <- c("b", "c", "d")
upset_list <- list(sample1 = sample1, sample2 = sample2)
from_list_to_upset_df(upset_list)
#>   sample1 sample2
#> a       1       0
#> b       1       1
#> c       1       1
#> d       0       1