| permute | R Documentation |
This function generates all possible permutations of the elements in a given
vector x. The result is returned as a matrix, where each row represents a
unique permutation of the input vector.
permute(x)
x |
A vector of elements to permute. The elements can be of any type, but they should be unique for meaningful permutations. |
A matrix where each row is a unique permutation of the input vector x.
Michal Burda
utils::combn() for combinations of elements.
permute(c(1, 2, 3))
permute(c("a", "b", "c"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.