Description Usage Arguments Details Value Note Author(s) Examples
Generates the power set of a given set of values.
1 |
x |
a vector. |
fileout |
a character string which contains name of the target file. |
only.file |
a logical. Only a file is created, if true (default=FALSE). |
Suppose you have a set S. The power set is the set off all subsets of S, including empty set and S itself.
The number of elements of the power set is 2^(number of elements of S). You can save the powerset in a file,
if a filename fileout
is specified.
Empty set will be excluded.
powerset
generates a list of all subsets of x, excluding empty set, if only.file=F.
powerset
is resctricted to vectors with maximum number of 15 elements.
Using only.file=T
you can create bigger powersets.
Sven Knueppel
1 2 | ps <- powerset(1:10)
ps
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.