title: Is there a way to create a data frame with rows for combinations of variables in other data frames?
body: <p>I have several data frames containing one column each. I want to create a data frame which has rows for each possible combination of the values in the other data frames.</p>
  
  <p>I tried a workaround with nested for loops for each data frame but since i have about 20 data frames it became tedious quite fast.</p>
  
  <pre><code># the data frames I already have
  df1 &lt;- data.frame(c("A","B","C")) 
  colnames(df1) &lt;- c("x")
  df2 &lt;- data.frame(c("ALPHA","BRAVO","CHARLIE")) 
  colnames(df2) &lt;- c("y")
  
  # the data frame I want to create
  df3 &lt;- data.frame(c("A", "A", "A", "B", "B", "B", "C", "C", "C"),
                    c("ALPHA","BRAVO","CHARLIE", "ALPHA","BRAVO","CHARLIE", "ALPHA","BRAVO","CHARLIE"))
  colnames(df3) &lt;- c("x", "y")
  </code></pre>