[R] All combination

RON70 ron_michael70 at yahoo.com
Fri Nov 13 10:02:36 CET 2009


Please consider the following :

> expand.grid(rep(list(c(1:3)), 3))
   Var1 Var2 Var3
1     1    1    1
2     2    1    1
3     3    1    1
4     1    2    1
5     2    2    1
6     3    2    1
7     1    3    1
8     2    3    1
9     3    3    1
10    1    1    2
11    2    1    2
12    3    1    2
13    1    2    2
14    2    2    2
15    3    2    2
16    1    3    2
17    2    3    2
18    3    3    2
19    1    1    3
20    2    1    3
21    3    1    3
22    1    2    3
23    2    2    3
24    3    2    3
25    1    3    3
26    2    3    3
27    3    3    3


Now I want to remove the rows which has any repetition of number. For
example I want to remove row 1-5 but not 6 and so on........

Is there any easy way to do that?

Thanks,
-- 
View this message in context: http://old.nabble.com/All-combination-tp26333348p26333348.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list