powerset {ggm} | R Documentation |
Power set
Description
Finds the list of all subsets of a set.
Usage
powerset(set, sort = TRUE, nonempty = TRUE)
Arguments
set |
A numeric or character vector. |
sort |
Logical value. If |
nonempty |
Logical value. If |
Details
If sort == FALSE
the sets are in inverse lexicographical order.
Value
A list of all subsets of set
.
Author(s)
Giovanni M. Marchetti
Examples
powerset(c("A", "B", "C"), nonempty = FALSE)
powerset(1:3, sort = FALSE, nonempty = TRUE)
[Package ggm version 2.5.1 Index]