1

For example, I have a vector like below,

a = c(1,2,3,4,5)

I want to rearrange it into the vector that no element are in its original position, that is

a' = c(2,3,1,5,4) # this one is correct

a'' = c(1,3,4,5,2) # this one is wrong

how can I do this

Nicolas H
  • 535
  • 3
  • 13
  • See also: https://stackoverflow.com/questions/7279895/shuffle-list-ensuring-that-no-item-remains-in-same-position – MrFlick Aug 20 '20 at 22:30

0 Answers0