permutations.Rd
Returns a matrix containing all permutations of the integers
1:n
(one permutation per row).
permutations(n)
n | Number of element to permute. |
---|
permutations(3)#> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 2 1 3 #> [3,] 2 3 1 #> [4,] 1 3 2 #> [5,] 3 1 2 #> [6,] 3 2 1