[R] generate combination set

Adrian Dusa dusa.adrian at gmail.com
Fri Nov 16 14:40:44 CET 2007


On Friday 16 November 2007, Peter Dalgaard wrote:
> [...]
>
> Or even (from someone who have known about combn for a while)
>
> > combn(LETTERS[1:7], 2, paste, collapse="")
>
>  [1] "AB" "AC" "AD" "AE" "AF" "AG" "BC" "BD" "BE" "BF" "BG" "CD" "CE"
> "CF" "CG"
> [16] "DE" "DF" "DG" "EF" "EG" "FG"

Chapeau...

Adrian


-- 
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
          +40 21 3120210 / int.101



More information about the R-help mailing list