Skip to contents

randomly shuffling vector

Usage

shuffle_vector(x, shuffle_rate, seed = 123456789)

Arguments

x

A vector.

shuffle_rate

The shuffling rate.

seed

(optional) Random seed number. Default is 123456789.

Value

A shuffled vector.

Examples

shuffle_vector(1:100,0.15)
#>   [1]  66  16  44  45  86  39  12  32   9  98  10  26  21  23  38   1   2   3
#>  [19]   4   5   6   7   8  11  13  14  15  17  18  19  20  22  24  25  27  28
#>  [37]  29  30  31  33  34  35  36  37  40  41  42  43  46  47  48  49  50  51
#>  [55]  52  53  54  55  56  57  58  59  60  61  62  63  64  65  67  68  69  70
#>  [73]  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  87  88  89
#>  [91]  90  91  92  93  94  95  96  97  99 100