Re: [R] generating unordered combinations

2009-09-23 Thread Dan
 0    0    1 > > [3,]    0    0    2 > > [4,]    0    1    1 > > [5,]    0    1    2 > > [6,]    0    2    2 > > [7,]    1    1    1 > > [8,]    1    1    2 > > [9,]    1    2    2 > > [10,]    2    2    2 > > > Bill Dunlap > > TIBCO So

Re: [R] generating unordered combinations

2009-09-18 Thread Bryan Keller
5,]012 > [6,]022 > [7,]111 > [8,]112 > [9,]122 > [10,]222 > > Bill Dunlap > TIBCO Software Inc - Spotfire Division > wdunlap tibco.com > >> -Original Message- >> From: r-help-boun...@r-pro

Re: [R] generating unordered combinations

2009-09-18 Thread Dan Halligan
22 Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Halligan Sent: Thursday, September 17, 2009 1:31 PM To: r-help@r-project.org Subject: [R] gener

Re: [R] generating unordered combinations

2009-09-17 Thread William Dunlap
lap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Halligan > Sent: Thursday, September 17, 2009 1:31 PM > To: r-help@r-project.org > Subject: [R] generating unordered combinations > &

Re: [R] generating unordered combinations

2009-09-17 Thread G. Jay Kerns
Dear Dan, On Thu, Sep 17, 2009 at 5:31 PM, Erik Iverson wrote: > Dan, > > Still maybe a bit ugly, but no looping... > >> unique(as.data.frame(t(apply(expand.grid(0:2, 0:2, 0:2), 1, sort The prob package provides a convenience wrapper for (essentially) Erik's solution: library(prob) urnsamp

Re: [R] generating unordered combinations

2009-09-17 Thread Erik Iverson
essage- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Dan Halligan > Sent: Thursday, September 17, 2009 3:31 PM > To: r-help@r-project.org > Subject: [R] generating unordered combinations > > Hi, > > I am trying to generate all u

[R] generating unordered combinations

2009-09-17 Thread Dan Halligan
Hi, I am trying to generate all unordered combinations of a set of numbers / characters, and I can only find a (very) clumsy way of doing this using expand.grid. For example, all unordered combinations of the numbers 0, 1, 2 are: 0, 0, 0 0, 0, 1 0, 0, 2 0, 1, 1 0, 1, 2 0, 2, 2 1, 1, 1 1, 1, 2 1,