powered by
Enumerates all permutations of a vector
perm(vec,duplicates=FALSE)
Returns a matrix where each row is a permutation of vec. All possible permutations are listed, and if duplicates=TRUE non-unique permutations are also listed.
duplicates=TRUE
The vector to permute
Should duplicate permutations be listed
sample
perm(1:4) perm(LETTERS[4:8])
Run the code above in your browser using DataLab