How to produce combinations iteratively in R? [duplicate]
问题 This question already has an answer here : How do I find all possible subsets of a set iteratively in R? (1 answer) Closed 6 years ago . So I am currently using the following code to generate my combinations: combn(x,y) But the thing is that function stores all of the possible combinations. I dont want to store them, I just want to produce them through like a loop or something. It would be way more efficient for my program. Is there a way to generate combinations through a for loop rather