# Combinations

4 messages
Open this post in threaded view
|

## Combinations

 Hi all, I´ve been ill and I have lost a lot of time without seen the pc. I want you to help if you can if you want. Only I need an initial guide. I´ve been out a lot of time and I need a hope. Is only for "joby" purposes. The problem: I want to simulate each of the posible combination in a play. Imagine they play to games (football games) and you can choose "1", "X", "2" you must choose this 15 times. So finally you will get a colum 15x1 si you have (3^15) posible colums. I want to extract all the columns were in the row 3 you can find an "2". Or in the row 3 appears a "1" and row 3 "x". And extract them and save in a txt document. Sorry I know that I only ask but actually I feel very fool. If you give an initial guide will be sufficient. Many thanks for all in advace.         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Combinations

 Dear ????, 15 is very big number for me (perhaps for R as well :() so I have tried following: mat <- expand.grid(rep(list(c("1", "X", "2")),4)); mat[mat[,3]=="2",]