title: permutation with repetition
body: <p>In R, how can I produce all the permutation of a group, but in this group there are some repetitive elements.</p>
  
  <p>Example :</p>
  
  <pre><code>A = {1,1,2,2,3} 
  </code></pre>
  
  <p>solution :</p>
  
  <pre><code>1,1,2,2,3
  1,1,2,3,2
  1,1,3,2,2
  1,2,1,2,3
  1,2,2,1,3
  1,2,2,3,1
  .
  .
  </code></pre>