set.seed(1234)
## unrestricted permutations
permuted.index2(20)
## observations represent a time series of line transect
permuted.index2(20, control = permControl(type = "series"))
## observations represent a time series of line transect
## but with mirroring allowed
permuted.index2(20, control = permControl(type = "series", mirror = TRUE))
## observations represent a spatial grid
perms <- permuted.index2(20, permControl(type = "grid",
ncol = 4, nrow = 5))
## view the permutation as a grid
matrix(matrix(1:20, nrow = 5, ncol = 4)[perms], ncol = 4, nrow = 5)
## random permutations in presence of strata
block <- gl(4, 5)
permuted.index2(20, permControl(strata = block, type = "free"))
## as above but same random permutation within strata
permuted.index2(20, permControl(strata = block, type = "free",
constant = TRUE))
## time series within each level of block
permuted.index2(20, permControl(strata = block, type = "series"))
## as above, but with same permutation for each level
permuted.index2(20, permControl(strata = block, type = "series",
constant = TRUE))
## spatial grids within each level of block
permuted.index2(100, permControl(strata = block, type = "grid",
ncol = 5, nrow = 5))
## as above, but with same permutation for each level
permuted.index2(100, permControl(strata = block, type = "grid",
ncol = 5, nrow = 5, constant = TRUE))
## permuting levels of block instead of observations
permuted.index2(20, permControl(strata = block, type = "strata"))
Run the code above in your browser using DataLab