title: R generate all possible interaction variables
body: <p>I have a dataframe with variables, say a,b,c,d</p>
  
  <pre><code>dat &lt;- data.frame(a=runif(1e5), b=runif(1e5), c=runif(1e5), d=runif(1e5))
  </code></pre>
  
  <p>and would like to generate all possible two-way interaction terms between each of the columns, that is: ab, ac, ad, bc, bd, cd. In reality my dataframe has over 100 columns, so I cannot code this manually. What is the most efficient way to do this (noting that I do not want both a<em>b and b</em>a)?</p>