rand_var.Rd
This function uses permutations or sampling with replacement to disrupt relationships between variables but keep the distribution of each variable constant. Variables should be in columns of a matrix.
rand_var(x, MARGIN = 2, replace = FALSE, prob = NULL)
x | matrix to be permuted |
---|---|
MARGIN | which dimension of a matrix to permute? Passed to |
replace | should sampling be with replacement? Passed to |
prob | a vector of probability weights for obtaining the elements of the vector being sampled. Passed to |
Matrix of the same dimention as the original matrix but with values in each column permuted.