Connects ff_scoringhistory to past ADP rankings
Source:R/1_outcomes_week.R
ffs_adp_outcomes_week.Rd
The backbone of the ffsimulator resampling process is coming up with a population of weekly outcomes for every inseason weekly 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_week(scoring_history, pos_filter = c("QB", "RB", "WR", "TE"))
Arguments
- scoring_history
a scoring history table as created by
ffscrapr::ff_scoringhistory()
- 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.
Examples
# \donttest{
# cached data
scoring_history <- .ffs_cache("mfl_scoring_history.rds")
ffs_adp_outcomes_week(scoring_history, pos_filter = c("QB","RB","WR","TE"))
#> pos rank week_outcomes
#> <char> <num> <list>
#> 1: QB 1 7.64, 7.64,32.88,24.48,11.44,24.30,...
#> 2: QB 2 32.94, 7.64,32.88,24.48,11.44,24.30,...
#> 3: QB 3 32.94, 2.56, 7.64,32.88,24.48,11.44,...
#> 4: QB 4 30.80, 6.96,28.76,13.32,32.94, 2.56,...
#> 5: QB 5 30.80, 6.96,28.76,13.32,21.10,24.46,...
#> ---
#> 476: WR 170 -0.2, 1.2, 0.0, 2.1, NA, NA,...
#> 477: WR 171 -0.2, 0.0, NA, NA, NA, NA,...
#> 478: WR 172 -0.2, 0.0, NA, NA, NA, NA,...
#> 479: WR 173 0,NA,NA,NA,NA,NA,...
#> 480: WR 174 0,NA,NA,NA,NA,NA,...
#> player_name
#> <list>
#> 1: Matt Ryan,Matt Ryan,Lamar Jackson,Lamar Jackson,Lamar Jackson,Lamar Jackson,...
#> 2: Matt Ryan,Matt Ryan,Lamar Jackson,Lamar Jackson,Lamar Jackson,Dak Prescott,...
#> 3: Matt Ryan,Matt Ryan,Matt Ryan,Lamar Jackson,Lamar Jackson,Lamar Jackson,...
#> 4: Kyler Murray,Matt Ryan,Matt Ryan,Matt Ryan,Lamar Jackson,Lamar Jackson,...
#> 5: Kyler Murray,Matt Ryan,Matt Ryan,Matt Ryan,Lamar Jackson,Lamar Jackson,...
#> ---
#> 476: Deonte Harty,Dwayne Harris,Johnny Holton,Jaleel Scott
#> 477: Deonte Harty,Johnny Holton
#> 478: Deonte Harty,Johnny Holton
#> 479: Johnny Holton
#> 480: Johnny Holton
#> fantasypros_id
#> <list>
#> 1: 9444,9444,17233,17233,17233,17233,...
#> 2: 9444,9444,17233,17233,17233,15600,...
#> 3: 9444,9444,9444,17233,17233,17233,...
#> 4: 18600,9444,9444,9444,17233,17233,...
#> 5: 18600,9444,9444,9444,17233,17233,...
#> ---
#> 476: 18876,10004,15803,17260
#> 477: 18876,15803
#> 478: 18876,15803
#> 479: 15803
#> 480: 15803
# }