powered by
systematically permute the input vector or list, which is very slow for long x. Am amazed something this simple isn't either in base R, or in a straightforward form in a package.
TODO: limit to a certain cut-off, after which we randomly sample
permute(x)
list or vector
data frame, each row being one permutation