Displaying 1 result from an estimated 1 matches for "nextsubset".
2000 Dec 17
1
functions for subsets: a minor R programming challenge
...The first one, subsets(), returns a matrix whose rows are all sets of size r
from the set of size n given by the vector v.
The second one, Subsets(), is a more involved version of the same thing but
can be much more efficient if you are dealing with large sets (but not too
large!)
The third one, nextSubset(), is designed to be called in a loop and returns
the next subset from the entire set arranged in lexicographic order. This
is for the case when you are working your way through the subsets one at a
time in a loop, anyway.
There is, however, a serious catch. The second and third functions are
S-...