Hi, I was wondering the what would be the (most efficient) way to generate a sequence of sequences, i mean:
if I have 1,2 and 3. I'd like to generate a sequence of length N*3 (N ~ 1,000,000 or more) Where random permutations of the sequence 1,2,3 follow each other. i.e 1,2,3,1,3,2,3,2,1 /!\ The thing is that there should never be twice the same number of in the same sub-sequence, meaning that this is different from generating a vector with the numbers 1,2 and 3 randomly distributed. Any suggestion very welcome! Thanks, Emmanuel ______________________________________________ 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.