Skip to contents

Utility function for data type conversion.

Usage

data_frame_to_list(x)

Arguments

x

A data.frame with logical columns representing sets.

Value

A list of sets.

Examples

d <- tibble(name = 1:6,
            A = c(rep(TRUE, 5), FALSE),
            B = rep(c(FALSE, TRUE), each = 3))
print(d)
#> # A tibble: 6 × 3
#>    name A     B    
#>   <int> <lgl> <lgl>
#> 1     1 TRUE  FALSE
#> 2     2 TRUE  FALSE
#> 3     3 TRUE  FALSE
#> 4     4 TRUE  TRUE 
#> 5     5 TRUE  TRUE 
#> 6     6 FALSE TRUE 
data_frame_to_list(d)
#> $A
#> [1] 1 2 3 4 5
#> 
#> $B
#> [1] 4 5 6
#>