Skip to content
Back to formatted view

Raw Message

Message-ID: <20692.5389.242742.472487@stat.math.ethz.ch>
Date: 2012-12-21T07:51:41Z
From: Martin Maechler
Subject: permutation of vectors (1 or 0)
In-Reply-To: <CANBtttaTr-0HfM-ZjOmuCjgv8FQgJJWP1CfyC07_squsnNPGnw@mail.gmail.com>

>>>>> Jeffrey Dick <j3ffdick at gmail.com>
>>>>>     on Thu, 20 Dec 2012 21:40:15 +0800 writes:

    > you might also try (names modified a bit since R already has a NULL object)
    >> Zeros <- rep(0,10)
    >> Ones <- rep(1,10)
    >> expand.grid(Map(c, Zeros, Ones))

Wow -- really neat!

Thank you, Jeff