Runs the bootstrapped resampling of player week outcomes on the latest rankings and rosters for a given number of seasons and weeks per season.
Arguments
- adp_outcomes
a dataframe of adp-based weekly outcomes, as created by
ffs_adp_outcomes()
- latest_rankings
a dataframe of rankings, as created by
ffs_latest_rankings()
- n
number of weeks to simulate
- rosters
a dataframe of rosters, as created by
ffs_rosters()
- optional, reduces computation to just rostered players
Value
a dataframe of weekly scores for each player in the simulation, approximately of length n_seasons x n_weeks x latest_rankings
Examples
# \donttest{
# cached examples
adp_outcomes_week <- .ffs_cache("adp_outcomes_week.rds")
latest_rankings_week <- .ffs_cache("latest_rankings_week.rds")
ffs_generate_projections_week(adp_outcomes_week, latest_rankings_week)
#> week fantasypros_id player pos team ecr sd rank
#> <int> <char> <char> <char> <char> <num> <num> <num>
#> 1: 5 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 2: 7 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 3: 9 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 4: 19 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 5: 28 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> ---
#> 276996: 266 19270 Devin Duvernay WR BAL 121.00 15.00 140
#> 276997: 690 18941 Jalen Guyton WR LAC 109.67 17.99 141
#> 276998: 95 19270 Devin Duvernay WR BAL 121.00 15.00 141
#> 276999: 523 19270 Devin Duvernay WR BAL 121.00 15.00 141
#> 277000: 345 19270 Devin Duvernay WR BAL 121.00 15.00 145
#> scrape_date projected_score projection gp_model season
#> <Date> <num> <num> <num> <num>
#> 1: 2021-09-06 NA NA 1 1
#> 2: 2021-09-06 NA NA 1 1
#> 3: 2021-09-06 29.86 29.86 1 1
#> 4: 2021-09-06 NA NA 1 1
#> 5: 2021-09-06 19.80 19.80 1 1
#> ---
#> 276996: 2021-09-06 NA NA 1 1
#> 276997: 2021-09-06 NA NA 1 1
#> 276998: 2021-09-06 NA NA 1 1
#> 276999: 2021-09-06 NA NA 1 1
#> 277000: 2021-09-06 NA NA 1 1
# }