View source: R/simulations_utils.R
nflseedR_compute_results | R Documentation |
This is the default nflseedR function to compute game results in season simulations.
nflseedR_compute_results(teams, games, week_num, ...)
teams |
A list of teams by simulation number. This is usually calculated automatically and not user facing. It can be used to "transport" team information like elo ratings from one simulated week to the next. Defaults to sims_teams_example. Please see this example to understand the required data structure. |
games |
An NFL schedule where some results are missing. |
week_num |
The week of a NFL season for which the function should compute results. |
... |
Additional parameters used in the function. It is possible to pass
the argument |
This function implements a variant of 538's elo model initially coded by Lee Sharpe (in nflseedR 1.0) and for performance rewritten by Sebastian Carl (in nflseedR 2.0).
A list of updated teams
and games
tables.
g <- nflseedR::sims_games_example
# The functions expects the variable "sim" instead of "season"
g$sim <- g$season
t <- nflseedR::sims_teams_example
out <- nflseedR_compute_results(
teams = t,
games = g,
week_num = 5L
)
str(out, max.level = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.