generate subsets of a set
Examples
generate_subsets(letters[1:3])
#> [[1]]
#> NULL
#>
#> [[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"
#>
generate_subsets(letters[1:3],empty = FALSE)
#> [[1]]
#> [1] "a"
#>
#> [[2]]
#> [1] "b"
#>
#> [[3]]
#> [1] "c"
#>
#> [[4]]
#> [1] "a" "b"
#>
#> [[5]]
#> [1] "a" "c"
#>
#> [[6]]
#> [1] "b" "c"
#>
#> [[7]]
#> [1] "a" "b" "c"
#>
generate_subsets(letters[1:3],self = FALSE)
#> [[1]]
#> NULL
#>
#> [[2]]
#> [1] "a"
#>
#> [[3]]
#> [1] "b"
#>
#> [[4]]
#> [1] "c"
#>
#> [[5]]
#> [1] "a" "b"
#>
#> [[6]]
#> [1] "a" "c"
#>
#> [[7]]
#> [1] "b" "c"
#>
generate_subsets(letters[1:3],empty = FALSE,self = FALSE)
#> [[1]]
#> [1] "a"
#>
#> [[2]]
#> [1] "b"
#>
#> [[3]]
#> [1] "c"
#>
#> [[4]]
#> [1] "a" "b"
#>
#> [[5]]
#> [1] "a" "c"
#>
#> [[6]]
#> [1] "b" "c"
#>