Description Usage Arguments Details Value
simulate many sets between two players, given the probability of each player winning a point on their serve
1 2 3 |
n |
number of simulations, default of 1000 |
pA |
probability of player A winning point on their first serve |
pB |
probability of player B winning point on their first serve |
playTiebreak |
logical, play tiebreak at 6 games all |
players |
player names, vector of length 2 |
p2A |
probability of player A winning point on their second serve |
firstServeA |
probability of player A getting their first serve in |
p2B |
probability of player B winning point on their second serve |
firstServeB |
probability of player B getting their first serve in |
.progress |
plyr's progress bar |
minimum input required is the probability that each player will win a point on their serve, however additional parameters include probability of each player winning a point on their second serve, the probability of a players first serve being in, and whether they play a tiebreak.
Adding a parameter ("text", or "time") to the .progress argument will cause two progress bars to show up, one after another, the first charts the simulation of many games, while the second processes these results into something more useful for users.
The function returns a large list, which can be printed, summarised, or plotted. It can also be converted to a dataframe using simDf, which contains data about the simulated sets, and games, within each simulation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.