-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
  • 15,779
  • 10
  • 54
  • 75
Maitree
  • 1
  • 1

1 Answers1

0

We can use combn

t(combn(vec1, 3))
akrun
  • 874,273
  • 37
  • 540
  • 662