[R] Looping over subsets

From: Z. Fang <zf216_at_cam.ac.uk>
Date: 20 Jan 2008 06:53:45 +0000


Hi,

Possibly a dumb question, but I wonder if anyone can help me with this. What I want to do, essentially, is to loop over all ordered subsets of a given size of a certain set. Ultimately, the idea is to find the subset that maximises a certain value.

The set in question is likely large (the subset size is likely small, though), so things like combn don't seem to be a good solution. The biggest concern is keeping memory usage sane, but processing time is also fairly important.

Any ideas?

Zhou Fang



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 Sun 20 Jan 2008 - 07:01:02 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 Sun 20 Jan 2008 - 14:30:06 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