title: Combination without repetition in R
body: <p>I am trying to get all the possible combinations of length 3 of the elements of a variable. Although it partly worked with combn() I did not quite get the output I was looking for. Here's my example</p>
  
  <pre><code>x &lt;- c("a","b","c","d","e")
  t(combn(c(x,x), 3)) 
  </code></pre>
  
  <p>The output I get looks like this</p>
  
  <pre><code>       [,1] [,2] [,3]
    [1,] "a"  "b"  "c" 
    [2,] "a"  "b"  "d" 
    [3,] "a"  "b"  "e" 
  </code></pre>
  
  <p>I am not really happy with this command for 2 reasons. I wanted to get an output that says "a+b+c" "a+b+b"...., unfortunately I wasn't able to edit the output with paste() or something.</p>
  
  <p>I was also looking forward for one combination of each set of letters, that is I either get "a+b+c" or "b+a+c" but not both. </p>