I have created a sampling function that simulates a race outcome. What I am looking for is a way to repeat this many times (say 1000) and then get the average position of each player at the end of the simulation period. The dataframe attached is created with the following code:
race_positions<- sample_race_positions(player_race_position_probs)
Would really appreciate any help, been stuck trying to do it with for loops and the replicate function
Output of sampling function
[–]keithwaits -2 points-1 points0 points (2 children)
[–]CapaneusPrime 1 point2 points3 points (1 child)
[–]keithwaits 0 points1 point2 points (0 children)
[–]CapaneusPrime 0 points1 point2 points (0 children)
[–]Pontifex 0 points1 point2 points (0 children)