[R] Permutation problem

michel lang michellang at gmail.com
Tue Jan 30 13:22:43 CET 2007


Dear R-Users,

I need a matrix containing line by line all possible permutations with
length 'i'  of the integers 1:N, given the restriction that the
integers in each row have to be in ascending order.

For example: N = 5, length i = 3, should result in a matrix like this:
1  2  3
1  2  4
1  2  5
1  3  4
1  3  5
1  4  5
2  3  4
2  3  5
2  4  5
3  4  5

I'm grateful for any advice on how to proceed,
  Michel Lang



More information about the R-help mailing list