[R] OT: algorithm for generating all possible combinations with replacement

2005-11-24 Thread Globe Trotter
Dear all, I have n objects and I want to select k of these with replacement. Do you know of code which would generate all the possible arrangements? Note that this is different from the selection of k of n objects without replacement and wanting to generate all the possible permutations. Any

Re: [R] OT: algorithm for generating all possible combinations with replacement

2005-11-24 Thread Kristel Joossens
I think you just need a sample with replacement sample(1:n,k,replace=TRUE) Best regards, Kristel Globe Trotter wrote: Dear all, I have n objects and I want to select k of these with replacement. Do you know of code which would generate all the possible arrangements? Note that this is