我有一个如下的数据框架.原始数据帧有100多行.
Df<;-data.Frame(a=Norm(10,0,1),B=Norm(10,1,2),C=Norm(10,2,1), D=范数(10,1,2)
a b c d
1 -0.56047565 3.44816359 0.9321763 1.8529284
2 -0.23017749 1.71962765 1.7820251 0.4098570
3 1.55870831 1.80154290 0.9739956 2.7902513
4 0.07050839 1.22136543 1.2711088 2.7562670
5 0.12928774 -0.11168227 1.3749607 2.6431622
6 1.71506499 4.57382627 0.3133067 2.3772805
7 0.46091621 1.99570096 2.8377870 2.1078353
8 -1.26506123 -2.93323431 2.1533731 0.8761766
9 -0.68685285 2.40271180 0.8618631 0.3880747
10 -0.44566197 0.05441718 3.2538149 0.2390580
I want to shuffle column b and column d 1000 times to get 1000 dataframes. In each data frame, value of each cell of column b should retain its corresponding value in column d as in the original dataframe. By the word'shuffle', I intend to say 'the order of columns has to be randomized' but the relative order of columns b and d should be maintained. To be clear, I want rows values to be re-ordered but with respect to columns b and d.