simSets: simSets

Description Usage Arguments Details Value

Description

simulate many sets between two players, given the probability of each player winning a point on their serve

Usage

1
2
3
simSets(n = 1000, pA, pB, playTiebreak = TRUE, players = c("A", "B"),
  p2A = NULL, firstServeA = NULL, p2B = NULL, firstServeB = NULL,
  .progress = "none")

Arguments

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

Details

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.

Value

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.


durtal/servevolleyR documentation built on May 15, 2019, 6:02 p.m.