perm | R Documentation |
Enumerates all permutations of a vector
perm(vec,duplicates=FALSE)
vec |
The vector to permute |
duplicates |
Should duplicate permutations be listed |
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.
sample
perm(1:4)
perm(LETTERS[4:8])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.