[R] Getting all possible combinations

Bert Gunter bgunter.4567 at gmail.com
Thu Aug 24 00:25:29 CEST 2017


Doesn't sort by size of subgroup. I interpret the phrase I asterisked as:

Your code does the following:

First subsets of size 1 are given.
Then all subsets of size 2.
Then all subsets of size 3.
etc.

Your code does not do this (quite).

If you meant something else, then please clarify.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Aug 23, 2017 at 3:14 PM, peter dalgaard <pdalgd at gmail.com> wrote:
>
>> On 23 Aug 2017, at 23:12 , Bert Gunter <bgunter.4567 at gmail.com> wrote:
>>
>>> This points to a different algorithm where you write 0:(2^n-1) as n-digit binary numbers and chose items corresponding to the 1s. That won't give the combinations **sorted by size of selected subgroup** though. Something like this:
>>
>> No it doesn't.
>> -- Bert
>
> Doesn't what? Do what I say it won't??
>
> -pd
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
>
>
>
>
>
>
>
>
>



More information about the R-help mailing list