[R] Generate a list of all subsequence of length k from an array

From: Ron Shefi <ron380_at_hotmail.com>
Date: Tue, 22 Jun 2010 06:35:17 +0000

I would like to generate a list of all subsequence of length k from an array with length n (k < n). The result should be organized in a matrix. So the matrix should look like the following whereas each row is one of a subsequence of len k.



Is there away to do this with sapply method?


The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.


        [[alternative HTML version deleted]]

R-help_at_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. Received on Tue 22 Jun 2010 - 07:51:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jun 2010 - 15:15:34 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.

list of date sections of archive