Verify a Custom CFB Result Simulation Function
Source:R/simulations_verify_fct.R
simulations_verify_fct.RdcfbseedR supports custom functions to compute results in season
simulations through the compute_results argument of
cfb_simulations(). This function verifies that a custom function
behaves as the simulator expects, mirroring nflseedR's
simulations_verify_fct(). It checks the output structure and whether
game results are changed as expected, and errors with a hint at the
first problem found.
Arguments
- compute_results
A function to compute results of games. Required arguments:
teams,games,week_num. It must returnlist(teams = teams, games = games)without removing rows or columns fromgames, must fillresultfor exactly the games withweek == week_num & is.na(result), must not modify any other result, and must not produce ties (result == 0) outside the regular season.- ...
Further arguments passed on to
compute_results.- games
A schedule where some results are missing. Defaults to the bundled toy season with all results from week 3 onwards blanked.
- teams
A teams table (
team,conference, optionallysim). Defaults to the bundled toy teams.