title: combining columns into one row by comma delimiter and them grouping up to sum other column in R programming
body: <p>I want to transpose data in such a way that column becomes single rows  </p>
  
  <pre><code>   col1    Col2                    Col3 Col4       Col5  
   1 344230. masalas &amp; spices        4    14           2
   2 344231. hair care               4    14           1
   3 344231. otc                     4    14           1
   4 344231. personal hygiene        4    14           1
   5 344232. detergents              4    14           2
   6 344233. biscuits                4    14           2
   7 344233. chocolates &amp; sweets     4    14           1
   8 344233. dry fruits              4    14           2    
  </code></pre>
  
  <p>Output will be like</p>
  
  <pre><code>col1   Col2                                    Col5
  344230 masalas &amp; spices                        2
  344231 hair care,otc,personal hygine           1+1+1=3
  344232 detergent                               2
  344233 biscuits,choclates&amp;sweets,dry fruits    2+1+ 2=5
  </code></pre>