title: Generate all possible permutations (or n-tuples)
body: <p>I'd like to create a data.frame of all possible permutations of 10 variables that can be either 1 or 2</p>
  
  <pre><code>2*2*2*2*2*2*2*2*2*2 = 1024 # possible
  
  1,1,1,1,1,1,1,1,1,1
  1,2,1,1,1,1,1,1,1,1
  1,2,2,1,1,1,1,1,1,1
  1,2,2,2,1,1,1,1,1,1
  ...
  </code></pre>
  
  <p>Is there a "quick" way to do this in R?</p>