title: Collapse data frame by unique values and combine all related values of other variable
body: <p>Let's say I have a matrix or data frame with two columns:</p>
  
  <pre><code>    marker &lt;- c("A1", "A2", "A2", "A3")  
      gene &lt;- c("gene1", "gene2", "gene3", "gene4")  
      cbind(marker, gene)  
  
       marker gene   
  [1,] "A1"   "gene1"
  [2,] "A2"   "gene2"
  [3,] "A2"   "gene3"
  [4,] "A3"   "gene4"
  </code></pre>
  
  <p>How can I convert this into a matrix or data frame that has one row for each unique marker and all associated genes? Ideally, I would like to get something like this:</p>
  
  <pre><code>     marker gene          
  [1,] "A1"   "gene1"       
  [2,] "A2"   "gene2";"gene3"
  [3,] "A3"   "gene4" 
  </code></pre>