Skip to content
Prev 190754 / 398498 Next

simple randomization question: How to perform "sample" in chunks

On Aug 20, 2009, at 11:22 AM, Tal Galili wrote:

            
It was a bit confusing to read that you wanted to "keep the order in  
column "b"", but your code implies that you wanted to carry the b- 
values along with the sorted a-values. I think this achieves the same  
goal:

xx[sample(1:nrow(xx)), ]