Skip to contents

Runs the bootstrapped resampling of player week outcomes on the latest rankings and rosters for a given number of seasons and weeks per season.

Usage

ffs_generate_projections_week(
  adp_outcomes,
  latest_rankings,
  n = 1000,
  rosters = NULL
)

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

See also

vignette("custom") for example usage

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:     1          17233  Lamar Jackson     QB    BAL   1.79  0.67     1
#>      2:     9          17233  Lamar Jackson     QB    BAL   1.79  0.67     1
#>      3:    18          17233  Lamar Jackson     QB    BAL   1.79  0.67     1
#>      4:    22          17233  Lamar Jackson     QB    BAL   1.79  0.67     1
#>      5:    30          17233  Lamar Jackson     QB    BAL   1.79  0.67     1
#>     ---                                                                     
#> 276996:   374          19270 Devin Duvernay     WR    BAL 121.00 15.00   145
#> 276997:   460          19270 Devin Duvernay     WR    BAL 121.00 15.00   145
#> 276998:   208          19270 Devin Duvernay     WR    BAL 121.00 15.00   148
#> 276999:   781          19270 Devin Duvernay     WR    BAL 121.00 15.00   148
#> 277000:   863          18318     Jalen Hurd     WR     SF 117.67 15.92   150
#>         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              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             0.9        0.9        1      1
# }