Learn R Programming

unitedR (version 0.2)

unitedSimOne: Simulating a formation

Description

Simulates a formation against another formation.

Usage

unitedSimOne(home, away, r, preventGoalGK = 1/14, preventGoalSW = 1/15)

Arguments

home
home team (an object of the S4class formation)
away
away team (an object of the S4class formation)
r
number of replications for the simulation of hardness and penalties, can be missing (exact results will be computed)
preventGoalGK
factor multiplicied with the strength of the GK for computing the probability of preventing a goal by the goalkeeper
preventGoalSW
factor multiplicied with the strength of the SW for computing the probability of preventing a goal by the sweeper

Value

Creates an object of the unitedSim class.

Examples

Run this code
home <- formation(10, NA, c(7,5,3), c(8,8), c(10,10,8))
away <- formation(5, 8, c(8,8), c(10,10), c(10,10,10),
 hardness = c(0,0,0,0,1))
set.seed(123)
unitedSimOne(home, away)
# you can even simulated the game
unitedSimOne(home, away, r = 100)

Run the code above in your browser using DataLab