Simulate using surrogate data

rsurrogate(x, n = length(x), p = 1, seed = 123)