title: Create a cartesian product of k vectors in R
body: <p>suppose I have a vector and I want to create a cartesian product of k same vectors, How do I implement this in R.</p>
  
  <p>Like, my vector is </p>
  
  <pre><code>m
  [1] 1 2
  </code></pre>
  
  <p>and k is 3,</p>
  
  <p>how do I get a result like a cartesian product of 3 m.</p>