partial_permut: Get partial permutation of a vector
Description
Get partial permutation of a vector
Usage
partial_permut(x, exp_sim = 0)
Value
a partially (random) permutated vector. If exp_sim = 0 then
the result is equal to sample(x) (a random permutation). If
exp_sim = 1 then the result is always the same as the input vector.
For exp_sim values between 0 and 1 we randomly sample
a subset of the input vector inversely proportionate to the exp_sim
value (e.g. exp_sim = 0.8 => 20% of the elements) and randomly
permutate these elements only.
Arguments
x
a vector with at least 2 elements
exp_sim
a value between 0 and 1 indicating the level of expected
similarity between the input and output vector. Default value is 0
(random permutation).