Description Usage Arguments Details Value
simulate many matches between two players, given the probability of each player winning a point on their serve
1 2 3 4 |
n |
number of simulations, default 1000 |
pA |
probability of player A winning point on their serve |
pB |
probability of player B winning point on their serve |
sets |
number of sets to be played |
tiebreaks |
play tie break at 6-6, or keep playing |
currentScore |
current set score |
finalSetTiebreak |
play tie break at 6-6 in final set |
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 |
detail |
return detailed data for the Match, default FALSE |
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, number of sets whether they play a tiebreak
If the parameter detail is set to TRUE, then the function will return a detailed list about the simulated match, including data about the indvidual sets and games in the match. This list can be converted to a dataframe using simDf. See
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.