Function for column permutation within rows of a matrix

permute.rows(x)

Arguments

x

A numerical matrix

Value

A matrix with permuted columns within rows.

Examples

data(BCdata) permute.rows(BCdata$X[1:10,1:5])
#> [,1] [,2] [,3] [,4] [,5] #> [1,] -0.10796905 0.15999371 -0.17342597 -0.08070489 -0.403625527 #> [2,] 0.01531136 -0.10634973 0.04344925 0.09020037 -0.006240341 #> [3,] 0.10140148 -0.12454291 0.23549721 0.24535762 0.773069655 #> [4,] -0.41946708 0.15286876 -0.16622646 -0.31898072 0.394057507 #> [5,] 0.29811844 0.11671790 -0.06379943 -0.05331554 0.319323285 #> [6,] 0.21548440 0.09788318 -0.02726088 0.05782617 -0.265967524 #> [7,] 0.03124611 -0.16639802 -0.06880862 0.15135401 -0.035671567 #> [8,] -0.26895419 -0.24798744 -0.02047316 0.35693587 0.048132021 #> [9,] 0.04173452 -0.17762381 -0.08802510 -0.17449929 0.060188356 #> [10,] -0.11722480 -0.06512387 0.15567327 -0.20685346 0.311883077