Adrian Dusa wrote:
> On Thursday 15 November 2007, [EMAIL PROTECTED] wrote:
>   
>> Actually, (now that I know about combn), a better way is
>>
>> t(matrix(set[combn(7,2)], nrow = 2))
>>     
>
> Indeed, or to avoid transposing:
>
> matrix(set[combn(7,2)], ncol = 2, byrow=T)
>
> Adrian
>
>   
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"



-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to