powered by
Finds the list of all subsets of a set.
powerset(set, sort = TRUE, nonempty = TRUE)
A numeric or character vector.
Logical value. If TRUE the subsets are sorted according to dimension. Default is TRUE.
TRUE
Logical value. If TRUE the empty set is omitted. Default is TRUE.
A list of all subsets of set.
set
If sort == FALSE the sets are in inverse lexicographical order.
sort == FALSE
# NOT RUN { powerset(c("A", "B", "C"), nonempty = FALSE) powerset(1:3, sort = FALSE, nonempty = TRUE) # }
Run the code above in your browser using DataLab