-1

I am getting a tough time in selecting the combinations of factors.

I have a vector as ("Ryan", "Leo", "Jack","Harry","Edd").

I want to get the list of of all combinations taken 3 of the names once.

I want to do it in R. Probably a resultant matrix will help me.

Jacques Gaudin
  • 14,274
  • 6
  • 46
  • 69
Maitree
  • 1
  • 1

1 Answers1

0

We can use combn

t(combn(vec1, 3))
akrun
  • 789,025
  • 32
  • 460
  • 575