Perhaps this? t(combn(c(2,3,4,5,6), 3))
HTH, Jorge.- On Wed, Mar 28, 2012 at 3:17 PM, Somnath Dhar <> wrote: > 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. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.