title: Concatenate values by group in descending order
body: <p>I want a data.My data A looks like</p>
  
  <pre><code>author_id paper_id prob
     731    24943    1
     731    24943    1
     731   688974    1
     731   964345    .8
     731  1201905    .9
     731  1267992    1
     736    249      .2
     736   6889      1
     736   94345    .7
     736  1201905    .9
     736  126992    .8
  </code></pre>
  
  <p>The output I am desiring is:</p>
  
  <pre><code>author_id    paper_id
    731        24943,24943,688974,1201905,964345
    736        6889,1201945,126992,94345,249
  </code></pre>
  
  <p>That is paper_id are arranged according to decreasing order of probability.</p>
  
  <p>If I use a combination of sql and R, i think the solution would be</p>
  
  <pre><code>statement&lt;-"select * from A 
              GROUP BY author_id
              ORDER BY prob"
  </code></pre>
  
  <p>Then in R using paste once the order is set for paper_id.</p>
  
  <p>But i need the total solution in R.How could this be done?</p>
  
  <p>Thanks </p>