permute | R Documentation |
Recursively generates all permutations of a vector. The result will be factorial(length(vals))
long so be careful with any longer vectors (e.g. longer than 10).
permute(vals)
vals |
a vector of elements to be permuted |
A list of vectors containing all permutation of the values
sample
permute(letters[1:3])
permute(1:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.