[R] combination of different vector values

Ngayee.Law@celeradiagnostics.com Ngayee.Law at celeradiagnostics.com
Fri Jun 14 19:16:19 CEST 2002


Hi,

Thanks in advance for the help.

I have a few vectors and I need to get all the combinations of the vector
values.
Normally I would use a few for-loops to do that.
e.g  x1_c(1,3,5)
     x2_c(2,5,6)
     for (i in x1) {
       for (j in x2) {
          ...
     }}

My problem is that I don't know how many vectors there are ahead of time,
so
I don't know how many for-loops I need. Any ideas how to implement this?

- Jacqueline




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list