expand.grid() is what you are looking for.

expand.grid(x1, x2, x3)
 
HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Marc Bernard
Verzonden: maandag 19 november 2007 16:00
Aan: [EMAIL PROTECTED]
Onderwerp: [R] sequence of vectors

Dear All,
   
  I wonder if there is any R function to generate a sequence of vectors
from existing ones. For example:
  x 1<- c(1,2,3)
  x2 <- c(4,5)
  x3 <- c(6,7,8)
   
  The desired output is a list of all 3*2*3 = 18 possible combinations
of elements of x1,x2 and x3. One element for example is (1,4,6).
   
  Many thanks in advance,
   
  Bernard
   
   

             
---------------------------------

        [[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.

______________________________________________
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.

Reply via email to