Permuting elements of a vector 10,000 times - efficiently? (R)
问题 This question is quite straightforward. However, the solutions that I have found to it are extremely memory and time inefficient. I am wondering if this can be done in R without grinding one's machine into dust. Take a vector: x<-c("A", "B", "B", "E", "C", "C", "D", "E", "A', "C") This one has 10 elements. There are five unique elements. Therefore, importantly, some elements are repeated and any permutation should contain the same total number of each type of element. I wish to permute this