Eik Vettorazzi wrote:
Hi Dani,
see ?combn .
combn(1:50,2)
gives you all combinations as matrix.
you can do sth like
apply(combn(1:50,2),2, paste, sep="", collapse="")
note that you could simplify the above by
combn(50, 2, paste, collapse = "")
Best,
Dimitris
to get concatenated results.
hth.
Dani Valverde schrieb:
Hello,
I have a sequence of numbers:
seq(1:50)
and I would like to have all the possible combinations with this
numbers without repeating any combination:
11, 12, 13, ... ,22,23,24,...
How can I do it?
Best,
Dani
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
______________________________________________
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.