recurse {magic} | R Documentation |
Recursively apply a permutation to a vector an arbitrary number of times. Negative times mean apply the inverse permutation.
recurse(start = 1:n, perm, i)
start |
Start vector to be permuted |
perm |
Permutation (integers 1 to length(start) in some order) |
i |
Number of times to apply the permutation. i=0 gives
start by definition |
Robin K. S. Hankin
recurse(start=rnorm(10),perm=sample(10),i=3)