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
#> 1: 2 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 2: 5 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 3: 7 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 4: 9 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> 5: 11 17233 Lamar Jackson QB BAL 1.79 0.67 1
#> ---
#> 276996: 770 19270 Devin Duvernay WR BAL 121.00 15.00 141
#> 276997: 190 19270 Devin Duvernay WR BAL 121.00 15.00 142
#> 276998: 825 18941 Jalen Guyton WR LAC 109.67 17.99 143
#> 276999: 286 19270 Devin Duvernay WR BAL 121.00 15.00 143
#> 277000: 744 19270 Devin Duvernay WR BAL 121.00 15.00 147
#> scrape_date projected_score projection gp_model season
#> 1: 2021-09-06 20.44 20.44 1 1
#> 2: 2021-09-06 28.81 28.81 1 1
#> 3: 2021-09-06 NA NA 1 1
#> 4: 2021-09-06 NA NA 1 1
#> 5: 2021-09-06 NA NA 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 2.00 2.00 1 1
# }