Maybe is an easy question, how generate the combination of a vector. I have the next vector.
> x<-1:5
> x
[1] 1 2 3 4 5
So what I want is a combination of all of them but the sequence must not contain same number in the combination and ab==ba, abc==bca==cab, that is:
permut<-c(1:5,12,13,14,15,23,24,25,34,...,123,124,125,134,135,...,1234,1235,...)
permut
[1] 1 2 3 4 5 12 13 14 15 23 24 25 34 ... 123 124 125 134 135 ... 1234 1235
I think the function expand.grid() can be useful but I don't know how use it exactly.