title: Collapsing duplicates in R where only the unique column values get condensed
body: <p>I need to collapse a large table (5M by V19) where I remove duplicates based on a specific column (V1), combine the values of all other columns if unique (if not, then report the result only once).</p>
  <p>I've tried some solutions from here but those examples were mostly performed on 2 variables - I have 19. What ends up happening is that entire rest of the table gets omitted as it is summarized by just a specific variable, as opposed to applying the collapse to all columns.</p>
  <p>Input:</p>
  <pre><code>V1         V2         V3         V4         V5         V6
  TR1000     chr1       1000       1200       A          + 
  TR1000     chr1       1100       1200       B          + 
  TR1000     chr1       1000       1200       C          +  
  TR2000     chr2       2000       2500       D          +   
  TR2000     chr2       2100       2500       E          + 
  TR3000     chr3       3000       3500       F          + 
  TR3000     chr3       3000       3500       F          + 
  
  </code></pre>
  <p>I Need:</p>
  <pre><code>V1         V2         V3              V4         V5        V6
  TR1000     chr1       1000|1100       1200       A|B|C     + 
  TR2000     chr2       2000|2100       2500       D|E       +  
  TR3000     chr3       3000            3500       F         + 
  </code></pre>