simMatches: simMatches

Description Usage Arguments Details Value

Description

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

Usage

1
2
3
4
simMatches(n = 1000, pA, pB, sets = c(3, 5), tiebreaks = TRUE,
  currentScore = c(0, 0), finalSetTiebreak = FALSE, players = c("A", "B"),
  p2A = NULL, firstServeA = NULL, p2B = NULL, firstServeB = NULL,
  .progress = "none")

Arguments

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

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, 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

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.