Displaying 1 result from an estimated 1 matches for "tp4127821p4128227".
2011 Dec 01
2
permutate elements in a vector
Hi all,
I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24
different combination. I want to generate a matrix with one combination in
one row, so the output would be
B =
10 20 30 40
10 40 20 30
...
Does anyone know how to do this easily in R? Thank you very much.
Wendy
--
View this message in context: