rperm()
as.cycle(rperm(30, 9))
rperm(10, 9, 2)
rcyc(20, 5)
rcyc(20, 5, 9)
rgivenshape(10, c(2,3)) # shape (3,2), size 5
rgivenshape(10, c(2,3,1,1)) # shape (3,2), but size 7
rgivenshape(1:9)
allpermslike(rgivenshape(c(1, 1, 3, 4)))
Run the code above in your browser using DataLab