Re: [R] enumerate subsets

2008-07-20 Thread Gabor Grothendieck
Try this replacing letters[1:4] with your set: > do.call(expand.grid, as.data.frame(rbind(letters[1:4], NA))) V1 V2 V3 V4 1 abcd 2 bcd 3 a cd 4 cd 5 ab d 6 b d 7 a d 8d 9 abc 10 b

Re: [R] enumerate subsets

2008-07-20 Thread jim holtman
Can you give a small example of what you data looks like and what you think the output should be. Have you looked at 'combn'? On Sun, Jul 20, 2008 at 4:33 PM, lamack lamack <[EMAIL PROTECTED]> wrote: > > Dear all, is there a R function that enumerate a partition of a vector of > size n? (of cour

Re: [R] enumerate subsets

2008-07-20 Thread Peter Dalgaard
lamack lamack wrote: Dear all, is there a R function that enumerate a partition of a vector of size n? (of course for n not very large). I would like enumerate all the (2 power n)-1 sub-sets. (2 power n)-1 since (2 power n) includes de empty subset. Best Regards. ps. It is not a homework. I n

[R] enumerate subsets

2008-07-20 Thread lamack lamack
Dear all, is there a R function that enumerate a partition of a vector of size n? (of course for n not very large). I would like enumerate all the (2 power n)-1 sub-sets. (2 power n)-1 since (2 power n) includes de empty subset. Best Regards. ps. It is not a homework. I never posted homework i