[R] Permutation problem

From: michel lang <michellang_at_gmail.com>
Date: Tue 30 Jan 2007 - 12:22:43 GMT


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



R-help@stat.math.ethz.ch 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. Received on Tue Jan 30 23:36:10 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 30 Jan 2007 - 13:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.