Skip to content
Prev 289880 / 398500 Next

How to get all possible combinations?

Dear all, suppose I have a vector with elements as:

Vec <- c(2,3,4,5,6)

Now I want to have all possible combination of length 3 using those
elements and without any repetition. Like, I want to have 1
possibility like 2-3-4 but not 3-2-4.

Can somebody guide me how to achieve that in R?

Thanks for your help.