Skip to contents

The backbone of the ffsimulator resampling process is coming up with a population of weekly outcomes for every preseason positional rank. This function creates that dataframe by connecting historical FantasyPros.com rankings to nflfastR-based scoring data, as created by ffscrapr::ff_scoringhistory().

Usage

ffs_adp_outcomes(
  scoring_history,
  gp_model = "simple",
  pos_filter = c("QB", "RB", "WR", "TE")
)

Arguments

scoring_history

a scoring history table as created by ffscrapr::ff_scoringhistory()

gp_model

either "simple" or "none" - simple uses the average games played per season for each position/adp combination, none assumes every game is played.

pos_filter

a character vector: filter the positions returned to these specific positions, default: c("QB","RB","WR","TE)

Value

a dataframe with position, rank, probability of games played, and a corresponding nested list per row of all week score outcomes.

See also

fp_rankings_history for the included historical rankings

fp_injury_table for the historical injury table

vignette("custom") for usage details.

Examples

# \donttest{
# cached data
scoring_history <- .ffs_cache("mfl_scoring_history.rds")

ffs_adp_outcomes(scoring_history, gp_model = "simple")
#>         pos  rank   prob_gp                           week_outcomes
#>      <char> <num>     <num>                                  <list>
#>   1:     QB     1 0.9265173 12.92,14.36,13.30,28.48, 9.42,18.32,...
#>   2:     QB     2 0.9250973  9.40,17.00, 9.70,17.78,-2.00,18.79,...
#>   3:     QB     3 0.9235976 20.56,21.10,24.46,17.68,33.23,32.94,...
#>   4:     QB     4 0.9219388 20.56,21.10,24.46,17.68,33.23,32.94,...
#>   5:     QB     5 0.9200411 20.56,21.10,24.46,17.68,33.23,32.94,...
#>  ---                                                               
#> 643:     WR   240 0.1362678                 1.8,0.9,2.8,1.3,0.3,1.6
#> 644:     WR   241 0.1343298                 1.0,2.1,1.8,0.9,0.3,1.6
#> 645:     WR   242 0.1323911        1.0, 2.1,14.5, 5.7, 6.7, 5.9,...
#> 646:     WR   243 0.1304520        1.0, 2.1,14.5, 5.7, 6.7, 5.9,...
#> 647:     WR   244 0.1285126        1.0, 2.1, 5.7, 6.3, 5.2,11.4,...
#>                                                                                          player_name
#>                                                                                               <list>
#>   1: Aaron Rodgers,Deshaun Watson,Deshaun Watson,Patrick Mahomes,Patrick Mahomes,Patrick Mahomes,...
#>   2:      Baker Mayfield,Aaron Rodgers,Deshaun Watson,Patrick Mahomes,Lamar Jackson,Dak Prescott,...
#>   3:         Matt Ryan,Baker Mayfield,Aaron Rodgers,Deshaun Watson,Patrick Mahomes,Lamar Jackson,...
#>   4:             Matt Ryan,Baker Mayfield,Aaron Rodgers,Deshaun Watson,Carson Wentz,Kyler Murray,...
#>   5:                 Matt Ryan,Cam Newton,Baker Mayfield,Aaron Rodgers,Carson Wentz,Kyler Murray,...
#>  ---                                                                                                
#> 643:                                                   Ashton Dulin,CJ Board,JoJo Natson,Marcus Kemp
#> 644:                                                 Fred Brown,Ashton Dulin,JoJo Natson,Marcus Kemp
#> 645:                                                             Fred Brown,Allen Lazard,Marcus Kemp
#> 646:                                                             Fred Brown,Allen Lazard,Marcus Kemp
#> 647:                                            Fred Brown,Marvin Hall,Allen Lazard,Darrius Shepherd
#>                              fantasypros_id
#>                                      <list>
#>   1: 9001,16398,16398,16413,16413,16413,...
#>   2: 17237,9001,16398,16413,17233,15600,...
#>   3:  9444,17237,9001,16398,16413,17233,...
#>   4:  9444,17237,9001,16398,15520,18600,...
#>   5:   9444,9869,17237,9001,15520,18600,...
#>  ---                                       
#> 643:                18656,16834,16854,16918
#> 644:                17160,18656,16854,16918
#> 645:                      17160,17301,16918
#> 646:                      17160,17301,16918
#> 647:                17160,16115,17301,19030
ffs_adp_outcomes(scoring_history, gp_model = "none")
#>         pos  rank prob_gp                           week_outcomes
#>      <char> <num>   <num>                                  <list>
#>   1:     QB     1       1 12.92,14.36,13.30,28.48, 9.42,18.32,...
#>   2:     QB     2       1  9.40,17.00, 9.70,17.78,-2.00,18.79,...
#>   3:     QB     3       1 20.56,21.10,24.46,17.68,33.23,32.94,...
#>   4:     QB     4       1 20.56,21.10,24.46,17.68,33.23,32.94,...
#>   5:     QB     5       1 20.56,21.10,24.46,17.68,33.23,32.94,...
#>  ---                                                             
#> 674:     WR   255       1                                     0,0
#> 675:     WR   256       1                                     0,0
#> 676:     WR   257       1                                     0,0
#> 677:     WR   258       1                                     0,0
#> 678:     WR   259       1                                     0,0
#>                                                                                          player_name
#>                                                                                               <list>
#>   1: Aaron Rodgers,Deshaun Watson,Deshaun Watson,Patrick Mahomes,Patrick Mahomes,Patrick Mahomes,...
#>   2:      Baker Mayfield,Aaron Rodgers,Deshaun Watson,Patrick Mahomes,Lamar Jackson,Dak Prescott,...
#>   3:         Matt Ryan,Baker Mayfield,Aaron Rodgers,Deshaun Watson,Patrick Mahomes,Lamar Jackson,...
#>   4:             Matt Ryan,Baker Mayfield,Aaron Rodgers,Deshaun Watson,Carson Wentz,Kyler Murray,...
#>   5:                 Matt Ryan,Cam Newton,Baker Mayfield,Aaron Rodgers,Carson Wentz,Kyler Murray,...
#>  ---                                                                                                
#> 674:                                                                                   Cyril Grayson
#> 675:                                                                                   Cyril Grayson
#> 676:                                                                                   Cyril Grayson
#> 677:                                                                                   Cyril Grayson
#> 678:                                                                                   Cyril Grayson
#>                              fantasypros_id
#>                                      <list>
#>   1: 9001,16398,16398,16413,16413,16413,...
#>   2: 17237,9001,16398,16413,17233,15600,...
#>   3:  9444,17237,9001,16398,16413,17233,...
#>   4:  9444,17237,9001,16398,15520,18600,...
#>   5:   9444,9869,17237,9001,15520,18600,...
#>  ---                                       
#> 674:                                  17096
#> 675:                                  17096
#> 676:                                  17096
#> 677:                                  17096
#> 678:                                  17096
# }