title: Allocating prizes in tournament with ties using R and data.table
body: <p>I'm dealing with tournament results in R where ties can happen. Say two players tie for 3rd place. They would share (3rd_prize + 4th_prize), and each earn (3rd_prize + 4th_prize)/2. If 10 players tie for third place, they would split the sum of 3rd through 13th place, and each get that sum over 10. </p>
  
  <p>Given this structure, and given a data.table listing all players, their absolute results, and how many people they drew with, how could we generate a column with everyone's winnings? I don't know how to format sample data in the post, so I'm attaching a link to a google sheet with sample data and a desired result if that's okay!</p>
  
  <p><a href="https://docs.google.com/spreadsheets/d/1fLUZ172Sl_yXVQE3VI0Xo4wSr_SRvaL43MCZIMYen2w/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1fLUZ172Sl_yXVQE3VI0Xo4wSr_SRvaL43MCZIMYen2w/edit?usp=sharing</a></p>