powered by
Stratified permutation of x within strata
permute_within_strata(x, strata, seed = NULL)
x_star permuted within strata.
vector to permute.
factor-like vector defining strata.
optional seed for reproducibility.
set.seed(123) x <- 1:10 strata <- rep(letters[1:2], each = 5) x_permuted <- permute_within_strata(x, strata, seed = 123)
Run the code above in your browser using DataLab