title: How to get the product of all combinations of values by column?
body: <p>for example, if I have a matrix as following</p>
  
  <pre><code>&gt; matrix(c(1, 1:8), nrow = 3)
       [,1] [,2] [,3]
  [1,]    1    3    6
  [2,]    1    4    7
  [3,]    2    5    8
  </code></pre>
  
  <p>then how to get a vector of the product of all combinations of values by column (listed below)?</p>
  
  <p>please note that 1 has repeated twice</p>
  
  <pre><code>1 * 3 * 6
  1 * 3 * 7
  1 * 3 * 8
  
  1 * 4 * 6
  1 * 4 * 7
  1 * 4 * 8
  
  1 * 5 * 6
  1 * 5 * 7
  1 * 5 * 8
  
  1 * 3 * 6
  1 * 3 * 7
  1 * 3 * 8
  
  1 * 4 * 6
  1 * 4 * 7
  1 * 4 * 8
  
  1 * 5 * 6
  1 * 5 * 7
  1 * 5 * 8
  
  2 * 3 * 6
  2 * 3 * 7
  2 * 3 * 8
  
  2 * 4 * 6
  2 * 4 * 7
  2 * 4 * 8
  
  2 * 5 * 6
  2 * 5 * 7
  2 * 5 * 8
  </code></pre>