Skip to contents

Provides a code framework for creating a combination matrix with code instead of using lists. Needed because sometimes ComplexHeatmap::make_comb_mat will choke on list elements.

Usage

ft_upset_comb_matrix()

Value

a string

Examples

  ft_upset_comb_matrix()
#> make_combination_matrix = function(list_items) {
#>   all_items = sort(unique(unlist(list_items)))
#>   comb_mat = matrix(0, nrow = length(all_items), ncol = length(list_items))
#>   colnames(comb_mat) = names(list_items)
#>   
#>   for (i_out in seq_along(list_items)) {
#>     comb_mat[all_items %in% list_items[[i_out]], i_out] = 1
#>   }
#>   return(comb_mat)
#> }