xg_sim_goal: xg_sim_goal

View source: R/xg_sim_goal.R

xg_sim_goalR Documentation

xg_sim_goal

Description

Simulate the number of goals scored given a vector of shot xG values

Usage

xg_sim_goal(shot_xg_list)

Arguments

shot_xg_list

List of shot xG values

Value

The simulated number of goals scored

Examples

set.seed(123)
# Create a data frame of shots
shots <- data.frame(shot = seq(1:10), xG = runif(n = 10, max = 1))

# Simulate the number of goals scored
shots |> pull(xG) |> xg_sim_goal()


stxlen/soccr documentation built on Feb. 17, 2025, 1:23 a.m.