Skip to contents

se_combn() is a helper function used internally to create all possible combinations of a set of variables. It is typically used for generating grouped summary tables as per Open Government Data formats.

Usage

se_combn(vars)

Arguments

vars

A character vector of variable names.

Value

A list of character vectors, each representing a unique combination of the input strings. The list includes the empty combination of length 0.

Examples

vars <- letters[1:3]
se_combn(vars)
#> [[1]]
#> character(0)
#> 
#> [[2]]
#> [1] "a"
#> 
#> [[3]]
#> [1] "b"
#> 
#> [[4]]
#> [1] "c"
#> 
#> [[5]]
#> [1] "a" "b"
#> 
#> [[6]]
#> [1] "a" "c"
#> 
#> [[7]]
#> [1] "b" "c"
#> 
#> [[8]]
#> [1] "a" "b" "c"
#>